Module:Param Parse: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
mNo edit summary |
InvalidCards (talk | contribs) (Value stuff) |
||
Line 194: | Line 194: | ||
smw_property = 'Release Date', |
smw_property = 'Release Date', |
||
smw_func = parse.release_smw, |
smw_func = parse.release_smw, |
||
} |
|||
-- Value |
|||
function parse.value_func(val) |
|||
val = tonumber(val) |
|||
local silver = math.floor(val / 1000) |
|||
local gold = math.floor(val / 1000000) |
|||
local output = '' |
|||
if gold > 0 then |
|||
output = gold .. '[[File:Gold coin.png|link=]]' |
|||
end |
|||
if silver > 0 then |
|||
output = output .. silver .. '[[File:Silver coin.png|link=]]' |
|||
end |
|||
output = output .. (val - (silver * 1000) - (gold * 1000000)) .. '[[File:Copper coin.png|link=]]' |
|||
return output |
|||
end |
|||
function parse.value_smw(val) |
|||
return tonumber(val) |
|||
end |
|||
parse.value = { |
|||
name = 'value', |
|||
func = parse.value_func, |
|||
category_incomplete = 'Needs value', |
|||
smw_property = 'Value', |
|||
smw_func = parse.value_smw |
|||
} |
} |
||