Module:AddSeparator

From Idlescape Wiki
Jump to navigation Jump to search

local p = {}

function p.addSeparator(frame)
	local args = frame:getParent().args
	return p._addSeparator(args)
end

function p._addSeparator(args)
	local num = args[1]
	local price = 0
	
	return tostring(num):reverse():gsub("(%d%d%d)","%1,"):gsub(",(%-?)$","%1"):reverse()
end

return p