Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How can I find the next multiple of 5 from a number?

I assume I could just round and look for the next number that isn't a decimal, but I'm sure there is a more optimized and better way to do this.

Say I have a player load in with the number 6 How can I find the next multiple of 5 (which is 10)

1 answer

✓ Accepted answer

(I'm using mobile sorry for typing mistakes)

local x = 6
local next5 = math.ceil(x/5)*5 -- x is the number, in your example x = 6
print(next5) -- prints out 10

This should do it! Hope it helped!

This discussion is preserved as it was. New answers, comments, and votes are closed.