Are dummy device numbers still floating point

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
GravityRZ
Normal user
Posts: 206
Joined: 23 Dec 2019, 21:24

Are dummy device numbers still floating point

#1 Post by GravityRZ » 30 Apr 2020, 15:26

i am experiencing rounding issues in Domoticz

i send over a dummy device value without any decimals.
Does this mean is is converted to a rounded number(integer) or is it still a floating number without decimals?
if so can i change this by adding a formula?

TD-er
Core team member
Posts: 8750
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Are dummy device numbers still floating point

#2 Post by TD-er » 30 Apr 2020, 20:11

The values stored in a dummy plugin are indeed of type float.
So this means that the precision is roughly 6 - 7 decimal digits, regardless of where the decimal point is placed.

You can format the output to contain 0 decimals, so the output will then be processed without decimals after the dot.
But it will not give you extra precision.
Meaning storing 12345678 may not result exactly this number.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 127 guests