Skip to content

Commit df80c0b

Browse files
authored
bug fixed avg price decimal rounding on graph mode (#26)
1 parent c45092e commit df80c0b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

price-timeline-card.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,7 @@ class PriceTimelineCard extends LitElement {
978978
const circleColor = data[currentIndex].price_per_kwh > avg ? "var(--orange)" : "var(--turquoise)";
979979
return html`
980980
<div>
981-
<h3 style="margin: 0px">${localize("label_average_price", lang)}: <span id="avgText">${avg*100} ${this._getCurrency(lang).name}</span></h3>
981+
<h3 style="margin: 0px">${localize("label_average_price", lang)}: <span id="avgText">${(avg*100).toFixed(1)} ${this._getCurrency(lang).name}</span></h3>
982982
<h5 style="margin: 0px; color:${circleColor}">${localize("label_price", lang)}: <span>${(data[currentIndex].price_per_kwh*100).toFixed(1)} ${this._getCurrency(lang).name} (${this._getDataTimeLabel(data, currentIndex)})</span></h5>
983983
</div>
984984
${this._generateChart(data, currentIndex, avg*100, lang)}

0 commit comments

Comments
 (0)