When I have implemented leveling systems I have generally done so in such a way that the user never saw the actual number for the experience requirement, and as such my numbers need not be as “clean” (multiples of 5, 10, etc) and as for the decimals that is easily solved with a built-in rounding method,.
Edit: obviously this was a low level implementation. You asked how we have done it, so that’s how I did it. I’m certainly not recommending that you use my lazy method.
This is code that I wrote for one of my projects. It took me a while to find the right curve and offset for my game. Lots of experimenting by printing for-loops with levels and exp deltas with the commandbar.
local exponent = 3
local lvlOffset = -4
local experienceOffset = -1250
return math.floor(.5+math.floor((exp-experienceOffset)/experienceMultiplier)^(1/exponent)) + lvlOffset
return math.floor(.5+((lvl-lvlOffset)^exponent)*experienceMultiplier + experienceOffset)
Note: The functions assume that exp is total exp, not the exp until the next level.
Althought its not using math.Floor it is quite effective And it makes it harder to level up each time so you can get to the first few levels easy, and it gets harder and harder (If any one could tell me the math so I could use math.Floor it would be great haha)