local e={}function e.Add(J,e)e=tostring(e)return#e%3==0 and(((e:reverse()):gsub("\040\037\100\037\100\037\100\041","\037\049\044")):reverse()):sub(2)or((e:reverse()):gsub("\040\037\100\037\100\037\100\041","\037\049\044")):reverse()end function e.Remove(J,e)if tonumber(e)then return e end for J=1,#e,1 do if string.sub(e,J,J)=="\044"then e=string.sub(e,1,J-1)..string.sub(e,J+1,#e)end end return e end return e


local Commas = {}

function Commas:Add(str)
	str = tostring(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

function Commas:Remove(str)
	if tonumber(str) then
		return str
	end

	for a = 1, #str do
		if string.sub(str, a, a) == "," then
			str = string.sub(str, 1, a - 1) .. string.sub(str, a + 1, #str)
		end
	end

	return str
end

return Commas
