I need help getting my Decimal points in order. But I want them atleast 1 place.
I'm counting gallons of water flowing and the meter only has 1 decimal place increments.
So I have my current meter reading, plus a starting point (min, hour, day, week) and I'm subtracting to find my total for that last period.
&hs.SetDeviceValueByRef(284,hs.DeviceValueEX(293)-hs.DeviceValueEX(279),False)
Something like this above but for some reason I end up with alot of decimal points even though I should not be. The Math is not right in a script. I start with only XXXX.X and subtract XXXX.X but I somehow end up with X.XXXXXXXXXXX for some reason.
Anyone have a reason why the math is off and how to fix it.
Also I know in the virtual device I can adjust it to round, but my problem is in my mobile app Imperihome it shows the whole value and also haven't figured out how to round.
Thanks,
I'm counting gallons of water flowing and the meter only has 1 decimal place increments.
So I have my current meter reading, plus a starting point (min, hour, day, week) and I'm subtracting to find my total for that last period.
&hs.SetDeviceValueByRef(284,hs.DeviceValueEX(293)-hs.DeviceValueEX(279),False)
Something like this above but for some reason I end up with alot of decimal points even though I should not be. The Math is not right in a script. I start with only XXXX.X and subtract XXXX.X but I somehow end up with X.XXXXXXXXXXX for some reason.
Anyone have a reason why the math is off and how to fix it.
Also I know in the virtual device I can adjust it to round, but my problem is in my mobile app Imperihome it shows the whole value and also haven't figured out how to round.
Thanks,
Comment