File tree 1 file changed +10
-4
lines changed
apps/OpenEnergyMonitor/myelectric
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -510,7 +510,8 @@ function slowupdate()
510
510
{
511
511
var use = config.app.use.value;
512
512
var use_kwh = config.app.use_kwh.value;
513
-
513
+ var unitcost = config.app.unitcost.value;
514
+
514
515
var interval = 86400;
515
516
var now = new Date();
516
517
var end = Math.floor(now.getTime() * 0.001);
@@ -524,10 +525,15 @@ function slowupdate()
524
525
}
525
526
526
527
if (usetoday_kwh!==null) {
527
- if (usetoday_kwh<100) {
528
- $("#usetoday").html((usetoday_kwh).toFixed(1));
528
+ if (viewmode == "energy") {
529
+ if (usetoday_kwh<100) {
530
+ $("#usetoday").html((usetoday_kwh).toFixed(1));
531
+ } else {
532
+ $("#usetoday").html((usetoday_kwh).toFixed(0));
533
+ }
529
534
} else {
530
- $("#usetoday").html((usetoday_kwh).toFixed(0));
535
+ var cost_today = usetoday_kwh*unitcost;
536
+ $("#usetoday").html((cost_today).toFixed(2));
531
537
}
532
538
} else {
533
539
$("#usetoday").html("---");
You can’t perform that action at this time.
0 commit comments