How to keep the last three valid numbers of a float?

Does anyone konws how to keep the last three valid numbers of a float? Thanks in anvance.

If you are looking to display the last 3 numbers of a float variable like ‘x’ you can use the String class constructor String::String(x, ‘3’); This returns a string with 3 digits after the decimal point which you can then use in a label or something similar.

1 Like

Ok, thank you so much, this is exactly what I need.:+1:

1 Like