i\'d like to format a number to look as follows \"1,234\" or \"1,234,432\" or \"123,456,789\", you get the idea. I tried doing this as follows;
function ref
I remember discussing about this in the LÖVE forums ... let me look for it...
Found it!
This will work with positive integers:
function reformatInt(i) return tostring(i):reverse():gsub("%d%d%d", "%1,"):reverse():gsub("^,", "") end
On the link above you may read details about implementation.