So I have this code:
function addCommas(str)
return #str % 3 == 0 and str:reverse():gsub("(%d%d%d)", "%1,"):reverse():sub(2) or str:reverse():gsub("(%d%d%d)", "%1,"):reverse()
end
But, that's way to complex for me. I need a way to more simply insert commas into numbers above 999.

5 comments
it works just fine dude idk what you're talking about this
literally just call the function using addComas(number)
Could get the length then scan through the original number, adding a comma in the desired position
wait, so you're saying i could just get the length of the number, then add a comma in every 3rd number?
yes