Module:Utils: Difference between revisions
Added input check, fixed how arguments work (I hope) |
Bug fixing |
||
Line 26: | Line 26: | ||
-- return x rounded to a precision of p decimal places | -- return x rounded to a precision of p decimal places | ||
function p.round(x, | function p.round(x, frame) | ||
-- x defaults to 0 if omitted | -- x defaults to 0 if omitted | ||
local x = eval_num_arg(frame.args[1], 0) | local x = eval_num_arg(frame.args[1], 0) |