Trailing zero's (f.e. "2.10") in custom device [Solved]
Posted: Saturday 06 June 2020 2:43
(Domoticz 2020.2, using dzVents)
For some reason virtual custom devices remove trailing decimal zero's, even when I feed it with
It does not matter whether myvalue is a number or a string.
Is this standard behavior from updateCustomSensor()?
I want the virtual custom device to represent a currency in visually pleasant way, f.e. "10.20" not "10.2".
Am I (absolute lua, Domoticz and dzVents beginner) doing something wrong?
For some reason virtual custom devices remove trailing decimal zero's, even when I feed it with
Code: Select all
mysensor.updateCustomSensor(string.format("%.2f", myvalue))It does not matter whether myvalue is a number or a string.
Is this standard behavior from updateCustomSensor()?
I want the virtual custom device to represent a currency in visually pleasant way, f.e. "10.20" not "10.2".
Am I (absolute lua, Domoticz and dzVents beginner) doing something wrong?