Module:Currency: Difference between revisions
no edit summary
(Created page with "local p = {} local function amount (a) a = string.gsub(a or '',',','') val = tonumber(a) if val == nil then return nil end local output = '' local gold = math.floor(val / 1000000) if gold > 0 then output = gold .. 'link= ' val = val - (gold * 1000000) end local silver = math.floor(val / 1000) if (silver > 0) or (gold > 0) then output = output .. silver .. 'link= ' val = val - (silver * 1000) end outpu...") |
No edit summary |
||
Line 25:
-- Module access point
--
function p.
a = tostring(a) or '0'
return amount(a)
|