Module:Param Parse: Difference between revisions
Append hours to duration param
m (Fix strict mode error) |
(Append hours to duration param) |
||
(6 intermediate revisions by 3 users not shown) | |||
Line 140:
-- Standardized description function
end▼
return parse.has_content(description)▼
end▼
parse.description = {
name = 'description',
smw_property = 'Description',
category_incomplete = 'Needs description',
Line 319 ⟶ 313:
-- Value
function parse.value_func(val)
local status, val = pcall(currency, val)
return currency(val)▼
if status then
▲ end
end
parse.value = {
Line 403 ⟶ 400:
func = {name = parse.number_or_number_range_high, params = {Infobox.raw_param('profession_b_level')}},
smw_property = 'Profession Level B High',
}▼
parse.profession = {▼
name = 'profession',▼
func = parse.has_content,▼
category_incomplete = 'Needs profession',▼
}
Line 425 ⟶ 415:
smw_func = parse.yes_no_smw,
category_incomplete = 'Needs passiveness'
▲}
function parse.duration_func(hours)
hours = string.gsub(hours or '',',','')
return (tonumber(hours) .. " Hours")
▲end
smw_property = 'Duration',
}
Line 529 ⟶ 531:
local level_valid = parse.number(level)
local profession_valid = parse.has_content(profession)
local profession_valid_link = profession_valid
if not profession_valid and not level_valid then
Line 545 ⟶ 548:
end
return '[[File:'..profession_valid..'_icon.png|link='..
end
|