Anonymous user
m
fix
en>Dragons flight (Add support for rounding to specified precsion) |
en>Dragons flight m (fix) |
||
Line 17:
-- Determine order of magnitude
function z.order(frame)
return
end
function z._order(x)
Line 111:
local value = tonumber( frame.args[1] or 0 );
local precision = tonumber( frame.args[2] or 0 );
local current_precision =
-- If rounding off, truncate extra digits
Line 123:
-- Handle cases requiring scientific notation
order =
if string.find( formatted_num, 'E', 1, true ) ~= nil or math.abs(order) >= 9 then
value = value * math.pow( 10, -order );
|