dz.utils.round (4.0,0) is not 4 but 4.0
Is that correct? If so, what is an easy way to make 4 out of 4.0?
dz.utils.round (4.0,0) is not 4
Moderator: leecollings
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: dz.utils.round (4.0,0) is not 4
Thx for reporting. need to look into that behavior but for now you can use math.floor(4.0)renerene wrote: Sunday 24 May 2020 22:25 dz.utils.round (4.0,0) is not 4 but 4.0
Is that correct? If so, what is an easy way to make 4 out of 4.0?
or if 4.0 is a variable:
rawNumber = 4.0
math.floor(rawNumber + 0.5)
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Re: dz.utils.round (4.0,0) is not 4
thank you
Who is online
Users browsing this forum: No registered users and 1 guest