Commit 00c478a 1 parent 419ec48 commit 00c478a Copy full SHA for 00c478a
File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ class PVPCHourlyPricingCard extends Polymer.Element {
42
42
< template is ="dom-if " if ="[[getTariffStatusIcon(pvpcHourlyPricingObj.attributes.tariff)]] ">
43
43
< ha-icon icon ="[[getTariffStatusIcon(pvpcHourlyPricingObj.attributes.tariff)]] "> </ ha-icon >
44
44
</ template >
45
- < div on-click ="_pvpcHourlyPricingAttr "> [[pvpcHourlyPricingObj.state]]< sup > [[pvpcHourlyPricingObj.attributes.unit_of_measurement]]</ sup > </ div >
45
+ < div on-click ="_pvpcHourlyPricingAttr "> [[getFixedFloat( pvpcHourlyPricingObj.state) ]]< sup > [[pvpcHourlyPricingObj.attributes.unit_of_measurement]]</ sup > </ div >
46
46
</ div >
47
47
< ha-chart-base data ="[[ChartData]] "> </ ha-chart-base >
48
48
< template is ="dom-repeat " items ="[[data]] "> </ template >
@@ -93,6 +93,10 @@ class PVPCHourlyPricingCard extends Polymer.Element {
93
93
getCardSize ( ) {
94
94
return 4 ;
95
95
}
96
+
97
+ getFixedFloat ( number ) {
98
+ return parseFloat ( number ) . toFixed ( 5 ) ;
99
+ }
96
100
97
101
getTariffStatusIcon ( tariff ) {
98
102
var icon ;
@@ -343,7 +347,7 @@ class PVPCHourlyPricingCard extends Polymer.Element {
343
347
}
344
348
345
349
var labelTitle = data . datasets [ tooltipItems . datasetIndex ] . label || '' ;
346
- var label = labelTitle + ': ' + tooltipItems . value + ' ' + energyUnit + ' ' ;
350
+ var label = labelTitle + ': ' + parseFloat ( tooltipItems . value ) . toFixed ( 5 ) + ' ' + energyUnit + ' ' ;
347
351
348
352
return icon ? label + icon : label ;
349
353
} ,
You can’t perform that action at this time.
0 commit comments