Skip to content

Commit 98fbddd

Browse files
authored
Update predbat-table-card.js
- fixed issue where old school load column wasn't showing 2 decimal places - fixed issue where SoC column was showing "100%-" incorrectly, now shows "100%"
1 parent a076ede commit 98fbddd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

predbat-table-card.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,9 @@ class PredbatTableCard extends HTMLElement {
508508
newContent = newContent.trim();
509509
}
510510
if(column === "total-column")
511-
newContent = this.adjustTotalCostField(newContent);
511+
newContent = this.adjustTotalCostField(newContent);
512+
if(column === "load-column")
513+
newContent = parseFloat(newContent).toFixed(2);
512514

513515
newCell.innerHTML = `<div class="iconContainer" title="${friendlyText}"><div style="margin: 0 2px;">${newContent}</div>${additionalArrow}</div>`;
514516
}
@@ -589,7 +591,7 @@ class PredbatTableCard extends HTMLElement {
589591
additionalArrow = '<ha-icon icon="mdi:arrow-up-thin" style="margin: 0 0 0 -5px;"></ha-icon>';
590592
newCell.style.paddingRight = "0px";
591593
} else {
592-
if(fillEmptyCells)
594+
if(fillEmptyCells && column === "cost-column")
593595
additionalArrow = '<ha-icon icon="mdi:minus" style="margin: 0 0 0 -5px; opacity: 0.25;"></ha-icon>';
594596
}
595597

0 commit comments

Comments
 (0)