neu-rah / ArduinoMenu

Arduino generic menu/interactivity system
GNU Lesser General Public License v2.1
948 stars 191 forks source link

Increase decimal places for float variables #355

Closed Lemings closed 3 years ago

Lemings commented 3 years ago

I need to increase precision for float variables from 2 decimal places to 4. Is there any way to do it? There is code in itemsTemplates.hpp seems to be dealing with decimal paces, but how to use it? template<uint8_t dps> template<typename T> idx_t decPlaces<dps>::menuField<T>::printReflex(menuOut& o) const {return o.print(Menu::menuField<T>::reflex,dps);}

Lemings commented 3 years ago

If found a solution, there is decimals field example. https://github.com/neu-rah/ArduinoMenu/blob/master/examples/plugin_decimalsField/plugin_decimalsField/plugin_decimalsField.ino Well it was not working for me out of box, but this plugin was working in my code.