timer on screen counts with more than 8 decimal place when it gets near to the end.
Mayhem_Madness
Member, PRO Posts: 168
Hello everyone, i have a timer and when it gets near the end of the timer on the screen, it goes to 8 decimal places, which i don't want i just want normally, e.g 1.1.
Anyone have any ideas why this is happening?
Thankyou.
Thor.
Comments
You can use the Precision Function to fix the number of decimal places.
precision (Function): Displays a floating point number with the specified number of decimal places.
For instance,prec(1234.234,2) will display 1234.23.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
The Precision function is no longer recommended, apparently it's not very efficient (I think it converts numerical data to text before doing its thing, which is releatively slow), the preferred function is roundTo (lowercase 'r', uppercase 'T') - it works the same way as the Precision function . . . . roundTo(1234.234,2) will display 1234.23
@socks, I didn't realize, thanks for the tip.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page