maakbaas / esp8266-iot-framework

Framework for IoT projects implementing HTTPS requests, a React web interface, WiFi manager, live dashboard, configuration manager, file manager and OTA updates.
GNU General Public License v3.0
417 stars 113 forks source link

Float number displayed on Dashboard with garbage number after the 6th decimal point #98

Closed cychrn closed 3 years ago

cychrn commented 3 years ago

I have an issue displaying a floating number (temperature and humidity) with 1 decimal point on Dashboard

The reading from sensor is with 1 decimal point. but when it displays on dashboard, it display weird number after the 6th decimal point

27.2 -> 27.200000762939453 59.6 -> 57.599998474121094

image

I have tried manipulating the number to remove the decimal points after the 6th digit still it was not working out...

could you please advise how to overcome this?

thank you very much in advanced.

maakbaas commented 3 years ago

Hi,

This was discussed in #61.

you can add a digits field to your JSON file to specify the number of digits that should be shown in the interface. This is also mentioned in the documentation.