I'm wanting to display numbers in shorthand, like 137B instead of putting 137,000,000,000 on the leaderboard. However, after 1e+23 (or 10^23), my function starts returning 9s in place of where 1s, 10s, and 100s should be. This is my current code:
_G.abbreviateLNum = function(n)
local orgN = n
local tableNum = 0
local x = 3
if n >= 1000 then
while n >= 1000 do
print(n)
n = math.floor(orgN/math.pow(10,x))
tableNum = tableNum + 1
x = x + 3
end
return n..NumberSuffixes[tableNum].."+"
else
return n
end
end
Thanks in advance for any suggestions/answers.

2 comments
https://pastebin.com/hCX7wSLi
Your code does work, but accomplishes the very same thing this script accomplishes. It also starts returning 9s at the same point. Thank you, though.