Hi everybody. I´m trying to make a counter with 2 decimals. I have used a float variable but there is a problem, when the number is bigger than 50000.00, it starts to round decimals and I can't write 50000.01 for example. I need to avoid this, could anybody help me please?
I have used lcd.print(totalizer, 2); so is not a lcd.print problem.
You have come across one of the limitations of the
float datatype: it is not good for large precise numbers.
What are you trying to count, and in what way are you trying to count it?
Clearly, you are not just trying to count (as in 1, 2, 3, 4, ...), because if you were, then you would not need decimals, and therefore would not see this problem.