Module:Utils: Difference between revisions
Moving signum() to Module:Utils |
round(): %g -> %f - the former uses exponential notation when it's shorter than floating point representation; it's undesirable |
||
Line 47: | Line 47: | ||
-- prec defaults to 6 | -- prec defaults to 6 | ||
prec = p.eval_num_arg(prec, 6) | prec = p.eval_num_arg(prec, 6) | ||
return string.format(string.format("%%.% | return string.format(string.format("%%.%df", prec), x) | ||
end | end | ||