timer on screen counts with more than 8 decimal place when it gets near to the end.

Mayhem_MadnessMayhem_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

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    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.

  • SocksSocks London, UK.Member Posts: 12,822

    @jamie_c said:
    You can use the Precision Function to fix the number of decimal places.

    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

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    @socks, I didn't realize, thanks for the tip.

Sign In or Register to comment.