No Decimal Places (HOW)

Hi there… how do I make it so that my timer does not display the decimal places when it increments by .10? I only want to see whole numbers… thanks

why not use math.round ?? I am not exactly sure what you are trying to accomplish, if you posted your code I am sure people will get a better idea of what you need!


If you are doing random numbers…

Math.random()*44 will produce decimal numbers

Math.round(Math.random()*44) will produce nice, clean, whole numbers.

and if you want to round down every time use Math.floor(number); :slight_smile:

or to round up the decimal number that is Math.ceil(number).

Ok, so let us review

No Decimals = Math.round(number)
Round a decimal down = Math.floor(number)
Round a decimal up = Math.ceil(number)

I hope this info helps.

No decimal => floor. What Bezzer said. Round will round, not cut the decimals.

pom :stuck_out_tongue: