Math.round() help

I’m using math.random(350,900) to give me a random number between 350 and 900, and then using math.round() on the number to ensure it isn’t a decimal. I have an issue though, i want the number to end up with a 0 on the end, so its not some random combination of numbers like 738.
if it was 738, i want it to go up to 740

would math.round() do this for me?

you could do this

math.random(35,90) * 10

2 Likes

Just for future reference, numbers generated via math.random(min, max) will always be whole number; the only time math.random will return a decimal is when you don’t provide any arguments:

math.random() -- generates a random number between 0 and 1
2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.