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.