How do I round DOWN to the nearest 100?

I’m making a levelling system using exp as a percentage of 100. I need a way to get a large amount of Experience (e.g 1250) level up that amount of times (12 times) and have the remaining exp left over (50).

To do this I need to round, specifically down, to the nearest 100.

I have no idea how to even go about this, so any help is appreciated. Many Thanks.

To round down to the nearest 100, you can use math.floor().

local n = 1250
local rounded = math.floor(n / 100) * 100
print(rounded) -- 1200
4 Likes

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