diff --git a/SolarPower/Views/ElectricitySoldRecord/Index.cshtml b/SolarPower/Views/ElectricitySoldRecord/Index.cshtml index 28e49e5..eb2c99e 100644 --- a/SolarPower/Views/ElectricitySoldRecord/Index.cshtml +++ b/SolarPower/Views/ElectricitySoldRecord/Index.cshtml @@ -544,9 +544,11 @@ }, { "data": "endAt" }, { - "data": "kwh" + "data": "kwh", + "render": $.fn.DataTable.render.number(",") }, { - "data": "money" + "data": "money", + "render": $.fn.DataTable.render.number(",") }, { "data": "createdDay" }, { diff --git a/SolarPower/Views/PowerGeneration/Index.cshtml b/SolarPower/Views/PowerGeneration/Index.cshtml index 2c1d9f4..f4f882d 100644 --- a/SolarPower/Views/PowerGeneration/Index.cshtml +++ b/SolarPower/Views/PowerGeneration/Index.cshtml @@ -567,19 +567,19 @@ str += "" + val.endAt + ""; str += "" + days + "天" + ""; str += "" + val.cbAeff + "%" + ""; - str += "" + (val.cbAkwh * val.cbAeff * days * val.capacity * 0.01).toFixed(2) + ""; - str += "" + (val.rate * (val.cbAkwh * val.cbAeff * days * val.capacity * 0.01)).toFixed(2) + ""; - str += "" + val.realKWH.toFixed(2) + ""; - str += "" + Math.round(val.realMoney) + ""; - str += "" + val.actualkwh.toFixed(2) + ""; - str += "" + Math.round(val.actualMoney) + ""; + str += "" + toThousands((val.cbAkwh * val.cbAeff * days * val.capacity * 0.01).toFixed(2)) + ""; + str += "" + toThousands((val.rate * (val.cbAkwh * val.cbAeff * days * val.capacity * 0.01)).toFixed(2)) + ""; + str += "" + toThousands(val.realKWH.toFixed(2)) + ""; + str += "" + toThousands(Math.round(val.realMoney)) + ""; + str += "" + toThousands(val.actualkwh.toFixed(2)) + ""; + str += "" + toThousands(Math.round(val.actualMoney)) + ""; var cba = val.cbAkwh * val.cbAeff * days * val.capacity * 0.01 / days / val.capacity; - str += "" + cba.toFixed(2) + ""; + str += "" + toThousands(cba.toFixed(2)) + ""; var real = val.realKWH / days / val.capacity; - str += "" + real.toFixed(2) + ""; + str += "" + toThousands(real.toFixed(2)) + ""; str += "" + ((cba == 0) ? 0 : ((real / cba - 1) * 100 ).toFixed(2)) + "%" + ""; var act = val.actualkwh / days / val.capacity; - str += "" + act.toFixed(2) + ""; + str += "" + toThousands(act.toFixed(2)) + ""; str += "" + ((cba == 0) ? 0 : ((act / cba - 1) * 100 ).toFixed(2)) + "%" + ""; str += ""; }) @@ -590,18 +590,18 @@ } var stra = ""; stra += ""; - stra += "" + capacity.toFixed(3) + ""; - stra += "" + cbAkwh.toFixed(2) + ""; - stra += "" + rate.toFixed(2) + ""; - stra += "" + capacity.toFixed(3) + ""; - stra += "" + rate.toFixed(2) + ""; - stra += "" + capacity.toFixed(3) + ""; - stra += "" + rate.toFixed(2) + ""; - stra += "" + (checkvalue ? 0 : (totalcbAkwh / totaldays / capacity).toFixed(2)) + ""; - stra += "" + ((totaldays == 0) ? 0 : (totalrealKWH / totaldays / capacity).toFixed(2)) + ""; - stra += "" + (checkvalue ? 0 : ((( (totalrealKWH / totaldays / capacity) / (totalcbAkwh / totaldays / capacity)) - 1) * 100).toFixed(2) ) + "%" + ""; - stra += "" + ((totaldays == 0) ? 0 : (totalactualkwh / totaldays / capacity).toFixed(2)) + ""; - stra += "" + (checkvalue ? 0 : ( (((totalactualkwh / totaldays / capacity) / (totalcbAkwh / totaldays / capacity)) - 1) * 100).toFixed(2) ) + "%" + ""; + stra += "" + toThousands(capacity.toFixed(3)) + ""; + stra += "" + toThousands(cbAkwh.toFixed(2)) + ""; + stra += "" + toThousands(rate.toFixed(2)) + ""; + stra += "" + toThousands(capacity.toFixed(3)) + ""; + stra += "" + toThousands(rate.toFixed(2)) + ""; + stra += "" + toThousands(capacity.toFixed(3)) + ""; + stra += "" + toThousands(rate.toFixed(2)) + ""; + stra += "" + (checkvalue ? 0 : toThousands((totalcbAkwh / totaldays / capacity).toFixed(2))) + ""; + stra += "" + ((totaldays == 0) ? 0 : toThousands((totalrealKWH / totaldays / capacity).toFixed(2))) + ""; + stra += "" + (checkvalue ? 0 : toThousands(((( (totalrealKWH / totaldays / capacity) / (totalcbAkwh / totaldays / capacity)) - 1) * 100).toFixed(2)) ) + "%" + ""; + stra += "" + ((totaldays == 0) ? 0 : toThousands((totalactualkwh / totaldays / capacity).toFixed(2))) + ""; + stra += "" + (checkvalue ? 0 : toThousands(( (((totalactualkwh / totaldays / capacity) / (totalcbAkwh / totaldays / capacity)) - 1) * 100).toFixed(2)) ) + "%" + ""; stra += ""; $('#totalbody').append(stra); $('#asbody').append(str); diff --git a/SolarPower/Views/PowerStation/Index.cshtml b/SolarPower/Views/PowerStation/Index.cshtml index cd0b781..f316a70 100644 --- a/SolarPower/Views/PowerStation/Index.cshtml +++ b/SolarPower/Views/PowerStation/Index.cshtml @@ -353,8 +353,8 @@ $('#solarTable' + val.cityId).find('tbody').append('' + '' + val.name + '' + - '' + val.generatingCapacity.toFixed(3) + '' + - '' + val.inverterAmount + '' + + '' + toThousands(val.generatingCapacity.toFixed(3)) + '' + + '' + toThousands(val.inverterAmount) + '' + '' + val.electricityMeterAt + '' + '' + ((val.status == 0) ? "停用" : "啟用") + '' + diff --git a/SolarPower/Views/StationOverview/Index.cshtml b/SolarPower/Views/StationOverview/Index.cshtml index b75e1e1..b4da057 100644 --- a/SolarPower/Views/StationOverview/Index.cshtml +++ b/SolarPower/Views/StationOverview/Index.cshtml @@ -456,17 +456,17 @@ $('#solarTable').find('tbody').append('' + '' + val.code + '' + '' + val.name + '' + - '' + val.generatingCapacity.toFixed(3) + '' + - '' + val.total_kWh.toFixed(2) + '' + - '' + val.today_kWh.toFixed(2) + '' + - '' + val.solarHour.toFixed(2) + '' + - '' + val.today_PR + '' + - '' + val.today_irradiance.toFixed(2) + '' + - '' + val.avg_irradiance.toFixed(2) + '' + + '' + (toThousands(val.generatingCapacity.toFixed(3))) + '' + + '' + (toThousands(val.total_kWh.toFixed(2))) + '' + + '' + (toThousands(val.today_kWh.toFixed(2))) + '' + + '' + (toThousands(val.solarHour.toFixed(2))) + '' + + '' + (toThousands(val.today_PR.toFixed(2))) + '' + + '' + (toThousands(val.today_irradiance.toFixed(2))) + '' + + '' + (toThousands(val.avg_irradiance.toFixed(2))) + '' + @if (ViewBag.myUser.Role.Auths.Contains("ShowMoney")) { - '' + val.today_Money.toFixed() + '' + + '' + (toThousands(val.today_Money.toFixed())) + '' + } '' + val.electricityMeterAt + '' + diff --git a/SolarPower/Views/StationOverview/StationOverviewInfo.cshtml b/SolarPower/Views/StationOverview/StationOverviewInfo.cshtml index dd93dbb..144cad7 100644 --- a/SolarPower/Views/StationOverview/StationOverviewInfo.cshtml +++ b/SolarPower/Views/StationOverview/StationOverviewInfo.cshtml @@ -1866,7 +1866,7 @@ $("#escrow_name_text").html(powerStationData.escrowName); $("#created_by_text").html(powerStationData.creatorName); - $("#generating_capacity_text").html(powerStationData.generatingCapacity.toFixed(3)); + $("#generating_capacity_text").html(toThousands(powerStationData.generatingCapacity.toFixed(3))); $("#estimated_recovery_time_text").html(powerStationData.estimatedRecoveryTime); $("#coordinate_text").html(powerStationData.coordinate); @@ -1874,8 +1874,8 @@ $("#power_station_operation_personnel").attr("disabled", true); $("#line_token_text").html(powerStationData.line_token); - $("#estimate_kwh_text").html(powerStationData.estimate_kwh); - $("#estimate_efficacy_text").html(powerStationData.estimateEfficacy); + $("#estimate_kwh_text").html(toThousands(powerStationData.estimate_kwh)); + $("#estimate_efficacy_text").html(toThousands(powerStationData.estimateEfficacy)); $("#created_at_text").html(powerStationData.createdAt); @if (ViewBag.myUser.Role.Layer == (int)RoleLayerEnum.PlatformAdmin || ViewBag.myUser.Role.Layer == (int)RoleLayerEnum.PlatformUser) @@ -1901,7 +1901,7 @@ $("#photovoltaic_panel_brand_text").html(powerStationData.photovoltaicPanelBrand); $("#photovoltaic_panel_product_model_text").html(powerStationData.photovoltaicPanelProductModel); $("#photovoltaic_panel_specification_text").html(powerStationData.photovoltaicPanelSpecification); - $("#photovoltaic_panel_amount_text").html(powerStationData.photovoltaicPanelAmount); + $("#photovoltaic_panel_amount_text").html(toThousands(powerStationData.photovoltaicPanelAmount)); //#endregion //#region 電站基本資料 input @@ -2612,12 +2612,12 @@ diffSOLARHOURALL = val.solarhour; $('#HistoryDetailTable').append('' + '' + val.timestamp + '' + - '' + val.kwh.toFixed(2) + '' + - '' + val.kwhkwp.toFixed(2) + '' + - '' + val.irrDay.toFixed(2) + '' + + '' + (toThousands(val.kwh.toFixed(2))) + '' + + '' + (toThousands(val.kwhkwp.toFixed(2))) + '' + + '' + (toThousands(val.irrDay.toFixed(2))) + '' + //'' + val.irradiance.toFixed(2) + '' + - '' + val.pr.toFixed(2) + '' + - '' + val.temp.toFixed(2) + '' + + '' + (toThousands(val.pr.toFixed(2))) + '' + + '' + (toThousands(val.temp.toFixed(2))) + '' + ''); listmonth.push(val.timestamp); listkwh.push(parseFloat(val.kwh.toFixed(2))); @@ -2642,12 +2642,12 @@ diffSOLARHOURALL += val.diffSOLARHOUR; $('#HistoryDetailTable').append('' + '' + val.timestamp + '' + - '' + val.kwh.toFixed(2) + '' + - '' + val.kwhkwp.toFixed(2) + '' + + '' + (toThousands(val.kwh.toFixed(2))) + '' + + '' + (toThousands(val.kwhkwp.toFixed(2))) + '' + //'' + val.irradiance.toFixed(2) + '' + - '' + val.pr.toFixed(2) + '' + - '' + val.temp.toFixed(2) + '' + + '' + (toThousands(val.pr.toFixed(2))) + '' + + '' + (toThousands(val.temp.toFixed(2))) + '' + ''); listmonth.push(val.timestamp); listkwh.push(parseFloat(val.kwh.toFixed(2))); @@ -2781,12 +2781,12 @@ { $('#HistoryTotalTable').append('' + '' + TimestampALL + '' + - '' + kwhALL.toFixed(2) + '' + - '' + kwhkwp + '' + + '' + (toThousands(kwhALL.toFixed(2))) + '' + + '' + (toThousands(kwhkwp)) + '' + //'' + irradianceALL.toFixed(2) + '' + // 改成累積日照 by jiahao 2022-04-30 00:444 - '' + avgIrr_day.toFixed(2) + '' + - '' + avgPR.toFixed(2) + '' + - '' + tempALL.toFixed(2) + '' + + '' + (toThousands(avgIrr_day.toFixed(2))) + '' + + '' + (toThousands(avgPR.toFixed(2))) + '' + + '' + (toThousands(tempALL.toFixed(2))) + '' + ''); } $('#all').show(); @@ -2809,15 +2809,15 @@ return; } $("#Invertercard-Name").html(rel.data.name); - $("#Invertercard-kwh").html(rel.data.today_kWh.toFixed(2)); + $("#Invertercard-kwh").html(toThousands(rel.data.today_kWh.toFixed(2))); @if (ViewBag.myUser.Role.Auths.Contains("ShowMoney")) { - $("#Invertercard-money").html(rel.data.today_Money.toFixed()); + $("#Invertercard-money").html(toThousands(rel.data.today_Money.toFixed())); } - $("#Invertercard-Capacity").html(rel.data.generatingCapacity.toFixed(3)); - $("#Invertercard-pr").html(rel.data.today_PR.toFixed(2)); + $("#Invertercard-Capacity").html(toThousands(rel.data.generatingCapacity.toFixed(3))); + $("#Invertercard-pr").html(toThousands(rel.data.today_PR.toFixed(2))); var str = "
" + "
" $('#prbar').remove(); @@ -2924,29 +2924,29 @@ str += '
'; str += '
'; str += '

輸出功率

'; - str += '

' + rel.data[a].output.toFixed(2) + '

'; + str += '

' + toThousands(rel.data[a].output.toFixed(2)) + '

'; str += '

kw

'; str += '
'; str += '
'; str += '
'; str += '
'; str += '

輸入功率

'; - str += '

' + rel.data[a].input.toFixed(2) + '

'; + str += '

' + toThousands(rel.data[a].input.toFixed(2)) + '

'; str += '

kw

'; str += '
'; str += '
'; str += '
'; str += '
'; - str += 'PR ' + rel.data[a].pr.toFixed(2) + '%'; + str += 'PR ' + toThousands(rel.data[a].pr.toFixed(2)) + '%'; str += '
'; str += '
'; - str += '
'; + str += '
'; str += '
'; str += '
'; str += '
'; str += '
'; str += '

日發電量

'; - str += '

' + rel.data[a].todaykwh.toFixed(2) + '

'; + str += '

' + toThousands(rel.data[a].todaykwh.toFixed(2)) + '

'; str += '

kWh

'; str += '
'; str += '
'; @@ -2986,29 +2986,29 @@ str += '
'; str += '
'; str += '

輸出功率

'; - str += '

' + rel.data[a].output.toFixed(2) + '

'; + str += '

' + toThousands(rel.data[a].output.toFixed(2)) + '

'; str += '

kw

'; str += '
'; str += '
'; str += '
'; str += '
'; str += '

輸入功率

'; - str += '

' + rel.data[a].input.toFixed(2) + '

'; + str += '

' + toThousands(rel.data[a].input.toFixed(2)) + '

'; str += '

kw

'; str += '
'; str += '
'; str += '
'; str += '
'; - str += 'PR ' + rel.data[a].pr.toFixed(2) + '%'; + str += 'PR ' + toThousands(rel.data[a].pr.toFixed(2)) + '%'; str += '
'; str += '
'; - str += '
'; + str += '
'; str += '
'; str += '
'; str += '
'; str += '
'; str += '

日發電量

'; - str += '

' + rel.data[a].todaykwh.toFixed(2) + '

'; + str += '

' + toThousands(rel.data[a].todaykwh.toFixed(2)) + '

'; str += '

kWh

'; str += '
'; str += '
'; @@ -3049,15 +3049,15 @@ { ACDetail += ""; ACDetail += "" + a + ""; - ACDetail += "" + rel.data['aC' + a + 'V'].toFixed(2) + ""; - ACDetail += "" + rel.data['aC' + a + 'A'].toFixed(2) + ""; + ACDetail += "" + toThousands(rel.data['aC' + a + 'V'].toFixed(2)) + ""; + ACDetail += "" + toThousands(rel.data['aC' + a + 'A'].toFixed(2)) + ""; ACDetail += ""; } ACDetail += ""; ACDetail += "輸出功率 " + ((rel.data.aC1W + rel.data.aC2W + rel.data.aC3W) / 1000).toFixed(2) + " KW"; ACDetail += ""; ACDetail += ""; - ACDetail += "PR " + rel.data.pr.toFixed(2) + " %"; + ACDetail += "PR " + toThousands(rel.data.pr.toFixed(2)) + " %"; ACDetail += ""; $('#inverterInfo-AC').empty(); @@ -3070,10 +3070,10 @@ for (var a = 1; a < 6; a++) { DCDetail += ""; DCDetail += "" + a + ""; - DCDetail += "" + rel.data['dC' + a + 'V'].toFixed(2) + ""; - DCDetail += "" + rel.data['dC' + a + 'A'].toFixed(2) + ""; - DCDetail += "" + rel.data['dC' + a + 'KW'].toFixed(2) + ""; - DCDetail += "" + rel.data['rA' + a ].toFixed(2) + ""; + DCDetail += "" + toThousands(rel.data['dC' + a + 'V'].toFixed(2)) + ""; + DCDetail += "" + toThousands(rel.data['dC' + a + 'A'].toFixed(2)) + ""; + DCDetail += "" + toThousands(rel.data['dC' + a + 'KW'].toFixed(2)) + ""; + DCDetail += "" + toThousands(rel.data['rA' + a ].toFixed(2)) + ""; DCDetail += ""; DCTOTAL += rel.data['dC' + a + 'W']; } diff --git a/SolarPower/Views/StationReport/Index.cshtml b/SolarPower/Views/StationReport/Index.cshtml index 40f36db..4529ff2 100644 --- a/SolarPower/Views/StationReport/Index.cshtml +++ b/SolarPower/Views/StationReport/Index.cshtml @@ -210,6 +210,7 @@ + @@ -328,6 +329,7 @@ $('#yearbtn').show(); $('#daybtn').show(); $('#year2btn').hide(); + $('#intervalbtn').hide(); //document.getElementById("monthbtn").disabled = true;//月報表鎖定 //document.getElementById("yearbtn").disabled = false;//綜合報表鎖定 //document.getElementById("daybtn").disabled = false;//日報表鎖定 @@ -358,6 +360,7 @@ $('#yearbtn').show(); $('#daybtn').show(); $('#year2btn').hide(); + $('#intervalbtn').hide(); @*document.getElementById("monthbtn").disabled = true;//月報表鎖定 document.getElementById("yearbtn").disabled = false;//綜合報表鎖定 document.getElementById("daybtn").disabled = false;//日報表鎖定*@ @@ -396,9 +399,10 @@ //#endregion $('#DateGettext').val(dateLimit_format + ' - ' + today_format); $('#daybtn').hide(); - $('#monthbtn').show(); + $('#monthbtn').hide(); $('#yearbtn').show(); $('#year2btn').hide(); + $('#intervalbtn').show(); @*document.getElementById("daybtn").disabled = true;//日報表鎖定 document.getElementById("monthbtn").disabled = false;//月報表鎖定 document.getElementById("yearbtn").disabled = false;//綜合報表鎖定*@ @@ -412,6 +416,7 @@ $('#monthbtn').show(); $('#yearbtn').show(); $('#year2btn').hide(); + $('#intervalbtn').hide(); @*document.getElementById("daybtn").disabled = true;//日報表鎖定 document.getElementById("monthbtn").disabled = false;//月報表鎖定 document.getElementById("yearbtn").disabled = false;//綜合報表鎖定*@ @@ -426,6 +431,7 @@ $('#monthbtn').hide(); $('#yearbtn').show(); $('#year2btn').show(); + $('#intervalbtn').hide(); @*document.getElementById("daybtn").disabled = true;//日報表鎖定 document.getElementById("monthbtn").disabled = true;//月報表鎖定 document.getElementById("yearbtn").disabled = false;//綜合報表鎖定*@ @@ -930,13 +936,13 @@ if (inverter[i] == null) { sta += "" + 0 + ""; } else { - sta += "" + Number(inverter[i]).toFixed(2) + ""; + sta += "" + toThousands(Number(inverter[i]).toFixed(2)) + ""; } }); - sta += "" + Number(inverter.hourKWH) + ""; - sta += "" + Number(inverter.hourKWHp) + ""; - sta += "" + Number(inverter.irradiance) + ""; // body 小時平均日照度 - sta += "" + Number(inverter.temperature) + ""; //body 小時平均模組溫度 + sta += "" + toThousands(Number(inverter.hourKWH)) + ""; + sta += "" + toThousands(Number(inverter.hourKWHp)) + ""; + sta += "" + toThousands(Number(inverter.irradiance)) + ""; // body 小時平均日照度 + sta += "" + toThousands(Number(inverter.temperature)) + ""; //body 小時平均模組溫度 if (showmoney == 1) { sta += "" + toThousands(Math.round(Number(inverter.hourmoney))) + ""; } @@ -964,10 +970,10 @@ var stb = ""; /* stb += "" + thour + "";*/ - stb += "" + kWhkwp + ""; //header - 有效發電小時 - stb += "" + tpr + ""; // - stb += "" + tkwh + ""; - stb += "" + GeneratingCapacity + ""; + stb += "" + toThousands(kWhkwp) + ""; //header - 有效發電小時 + stb += "" + toThousands(tpr) + ""; // + stb += "" + toThousands(tkwh) + ""; + stb += "" + toThousands(GeneratingCapacity) + ""; if (showmoney == 1) { stb += "" + toThousands(Math.round(ntd)) + ""; stb += "" + Math.round(ntdone * 10000) / 10000 + ""; @@ -1000,15 +1006,15 @@ if (inverter[i] == null) { sta += "" + 0 + ""; } else { - sta += "" + inverter[i] + ""; + sta += "" + toThousands(inverter[i]) + ""; } }); - sta += "" + inverter.dayKWH + ""; - sta += "" + ((inverter.dayKWHp == null) ? 0 : inverter.dayKWHp) + ""; + sta += "" + toThousands(inverter.dayKWH) + ""; + sta += "" + ((inverter.dayKWHp == null) ? 0 : toThousands(inverter.dayKWHp)) + ""; sta += "" + inverter.tothour + ""; - sta += "" + inverter.KWHKWP + ""; - sta += "" + ((inverter.PR == null) ? 0 : inverter.PR.toFixed(2)) + ""; - sta += "" + ((inverter.IrrDay == null) ? 0 : inverter.IrrDay) + ""; + sta += "" + toThousands(inverter.KWHKWP) + ""; + sta += "" + ((inverter.PR == null) ? 0 : toThousands(inverter.PR.toFixed(2))) + ""; + sta += "" + ((inverter.IrrDay == null) ? 0 : toThousands(inverter.IrrDay)) + ""; sta += "" + inverter.temperature + ""; if (showmoney == 1) { sta += "" + toThousands(Math.round(inverter.soldmoney)) + ""; @@ -1060,13 +1066,13 @@ } else { /*stb += "" + (avghour / monthday).toFixed(2) + "";*/ - stb += "" + (avgKWHKWP / monthday).toFixed(2) + ""; - stb += "" + (avgdayKWH / monthday).toFixed(2) + ""; - stb += "" + monthKWH + ""; - stb += "" + GeneratingCapacity + ""; + stb += "" + toThousands((avgKWHKWP / monthday).toFixed(2)) + ""; + stb += "" + toThousands((avgdayKWH / monthday).toFixed(2)) + ""; + stb += "" + toThousands(monthKWH) + ""; + stb += "" + toThousands(GeneratingCapacity) + ""; if (showmoney == 1) { - stb += "" + (monthmoney / GeneratingCapacity).toFixed(3) + ""; + stb += "" + toThousands((monthmoney / GeneratingCapacity).toFixed(3)) + ""; stb += "" + toThousands(Math.round(monthmoney)) + ""; stb += "" + Math.round(monthmoneyone / monthday*10000)/10000 + ""; } @@ -1126,16 +1132,16 @@ if (inverter[i] == null) { sta += "" + 0 + ""; } else { - sta += "" + inverter[i] + ""; + sta += "" + toThousands(inverter[i]) + ""; } }); - sta += "" + inverter.dayKWH + ""; - sta += "" + inverter.dayKWHp + ""; - sta += "" + inverter.tothour + ""; - sta += "" + inverter.KWHKWP + ""; - sta += "" + inverter.PR.toFixed(2) + ""; - sta += "" + inverter.irradiance + ""; - sta += "" + inverter.temperature + ""; + sta += "" + toThousands(inverter.dayKWH) + ""; + sta += "" + toThousands(inverter.dayKWHp) + ""; + sta += "" + toThousands(inverter.tothour) + ""; + sta += "" + toThousands(inverter.KWHKWP) + ""; + sta += "" + toThousands(inverter.PR.toFixed(2)) + ""; + sta += "" + toThousands(inverter.irradiance) + ""; + sta += "" + toThousands(inverter.temperature) + ""; if (showmoney == 1) { sta += "" + toThousands(Math.round(inverter.soldmoney)) + ""; } @@ -1143,7 +1149,7 @@ avghour += inverter.tothour ? inverter.tothour : 0; avgKWHKWP += inverter.KWHKWP ? inverter.KWHKWP : 0; avgdayKWH += inverter.dayKWH ? inverter.dayKWH : 0; - monthKWH = inverter.monthKWH ? inverter.monthKWH : 0; + monthKWH = inverter.monthKWH ? toThousands(inverter.monthKWH) : 0; monthmoney = inverter.monthmoney ? inverter.monthmoney : 0; monthmoneyone += inverter.monthmoneyone ? inverter.monthmoneyone : 0; @@ -1184,7 +1190,7 @@ else { stb += "" + (avghour / monthday).toFixed(2) + ""; stb += "" + (avgKWHKWP / monthday).toFixed(2) + ""; - stb += "" + (avgdayKWH / monthday).toFixed(2) + ""; + stb += "" + toThousands((avgdayKWH / monthday).toFixed(2)) + ""; stb += "" + monthKWH + ""; if (showmoney == 1) { stb += "" + toThousands(Math.round(monthmoney)) + ""; @@ -1210,7 +1216,7 @@ $.each(rel.data, function (index, value) { std += ""; std += "" + value.landowner + ""; - std += "" + value.leaseRate + "%" + ""; + std += "" + toThousands(value.leaseRate) + "%" + ""; std += "" + toThousands(Math.round(monthmoney * value.leaseRate / 100)) + ""; std += "" + toThousands(Math.round(monthmoney * value.leaseRate / 100 * 1.05)) + ""; std += ""; @@ -1361,17 +1367,17 @@ StrInfoBody += ""; - StrInfoBody += "" + data.cityName + data.areaName + ""; + StrInfoBody += "" + data.cityName + data.areaName + ""; StrInfoBody += "" + data.powerstationName + ""; - StrInfoBody += "" + data.kwh.toFixed(2) + ""; // 發電量 - StrInfoBody += "" + data.avgKWHKWP.toFixed(2) + ""; // 有效發電小時 - StrInfoBody += "" + data.avgIrradiance.toFixed(2) + ""; // 平均日照 - StrInfoBody += "" + data.avgPR.toFixed(2) + ""; + StrInfoBody += "" + toThousands(data.kwh.toFixed(2)) + ""; // 發電量 + StrInfoBody += "" + toThousands(data.avgKWHKWP.toFixed(2)) + ""; // 有效發電小時 + StrInfoBody += "" + toThousands(data.avgIrradiance.toFixed(2)) + ""; // 平均日照 + StrInfoBody += "" + toThousands(data.avgPR.toFixed(2)) + ""; if (showmoney == 1) { StrInfoBody += "" + toThousands(Math.round(data.todayMoney)) + ""; - StrInfoBody += "" + toThousands(Math.round(data.todayMoney * hirerate * 0.01))+ ""; + StrInfoBody += "" + Math.round(data.todayMoney * hirerate * 0.01)+ ""; StrInfoBody += "" + toThousands(Math.round(data.todayMoney)) + ""; } @@ -1387,8 +1393,8 @@ $.each(CityArray, function (index, data) { CityInfoBody += ""; CityInfoBody += "" + data.city + ""; - CityInfoBody += "" + (data.kwp / data.count).toFixed(2) + ""; - CityInfoBody += "" + (data.kwhkwp / data.count).toFixed(2) + ""; + CityInfoBody += "" + toThousands((data.kwp / data.count).toFixed(2)) + ""; + CityInfoBody += "" + toThousands((data.kwhkwp / data.count).toFixed(2)) + ""; CityInfoBody += ""; }) //上面 @@ -1410,8 +1416,8 @@ - TotalBody += "" + kwp.toFixed(2) + ""; - TotalBody += "" + (kwhkwp / rel.data.length).toFixed(2) + ""; + TotalBody += "" + toThousands(kwp.toFixed(2)) + ""; + TotalBody += "" + toThousands((kwhkwp / rel.data.length).toFixed(2)) + ""; TotalBody += ""; //#endregion diff --git a/SolarPower/Views/User/Index.cshtml b/SolarPower/Views/User/Index.cshtml index 9a35447..f8ffddf 100644 --- a/SolarPower/Views/User/Index.cshtml +++ b/SolarPower/Views/User/Index.cshtml @@ -171,7 +171,8 @@ }, { "data": "phone" }, { - "data": "spStationAmount" + "data": "spStationAmount", + "render": $.fn.DataTable.render.number(",") }, { "data": "createdAt" }, {