Module:Utils: Difference between revisions

Fredg999 (talk | contribs)
Bug fixing
Fredg999 (talk | contribs)
Made eval_num_arg global (for use in other modules only, not in regular pages)
Line 1: Line 1:
local p = {}
local p = {}


-- evaluate input on error use default
-- evaluate input on error use default; cannot be used with {{#invoke:}}
local function eval_num_arg(input, def_value)
function p.eval_num_arg(input, def_value)
local result = input
local result = input
if type(input) ~= 'number' then
if type(input) ~= 'number' then