add a truthy check too
(Created page with "local p = {} function p.fetch(frame) local template = nil local return_value = nil -- Use demo parameter if it exists, otherswise use current template name local namespa...") |
>ProcrastinatingReader (add a truthy check too) |
||
Line 29: | Line 29: | ||
if return_value == nil and frame.args[1] ~= nil then | if return_value == nil and frame.args[1] ~= nil then | ||
local arg1=mw.ustring.match(frame.args[1], '[%d,]+') | local arg1=mw.ustring.match(frame.args[1], '[%d,]+') | ||
return_value = tonumber(frame:callParserFunction('formatnum', arg1, 'R')) | if arg1 and arg1 ~= '' then | ||
return_value = tonumber(frame:callParserFunction('formatnum', arg1, 'R')) | |||
end | |||
end | end | ||