I wrote this awhile ago, it’s probably slow but it should work:
local function formatNumber(number)
local numberString = tostring(number)
local amountOfCommas = math.round(numberString:len() / 3)
local splitString = numberString:split('')
for i = numberString:len() - 2, 1, -3 do
if i ~= 1 then
table.insert(splitString, i, ',')
end
end
return table.concat(splitString)
end
Thank you for the code, it really helped me! BTW I am streaming this development on twitch… https://twitch.tv/rogamxr Feel free to say heyyo thx for the help again!