diff --git a/Controllers/building_four.Controller.cs b/Controllers/building_four.Controller.cs index c485859..2f55e6b 100644 --- a/Controllers/building_four.Controller.cs +++ b/Controllers/building_four.Controller.cs @@ -113,6 +113,35 @@ namespace rmutr_report.Controllers { if (boqPrice.is_data == "1") { + string str = boqPrice.have; + if (str.Length == 4) + { + for (int i = 1; i <= str.Length - 1; i += 4) + { + boqPrice.have = str.Insert(i, ","); + } + } + else if (str.Length == 5) + { + for (int i = 2; i <= str.Length - 1; i += 5) + { + boqPrice.have = str.Insert(i, ","); + } + } + else if (str.Length == 6) + { + for (int i = 3; i <= str.Length - 1; i += 6) + { + boqPrice.have = str.Insert(i, ","); + } + } + else if (str.Length == 7) + { + for (int i = 4; i <= str.Length - 1; i += 7) + { + boqPrice.have = str.Insert(i, ","); + } + } boqPrice.text1 = "- มี วงเงิน "+ boqPrice.have + " บาท"; boqPrice.text2 = "- ดำเนินการจัดทำ BOQ เดือน "+ boqPrice.pending_boq_month; boqPrice.text3 = "- BOQ แล้วเสร็จเดือน "+ boqPrice.done_boq_month; @@ -127,6 +156,7 @@ namespace rmutr_report.Controllers boqPrice.text3 = "- ขณะนี้อยูในขั้นตอน "+ boqPrice.step; } + }