I think you don't have to format the currentkWh on the puck.
currentkWh
Just use toFixed on the display page. For example:
toFixed
var kwh = 1234.56789; console.log(kwh.toFixed(2)) "1234.57"
Separation of data & display concerns :)
Yes, you're right, I should just format it on the page. Thanks.
@Fisu started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I think you don't have to format the
currentkWh
on the puck.Just use
toFixed
on the display page. For example:Separation of data & display concerns :)