Module:Math: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
en>Dragons flight (deal with unary minus) |
en>Dragons flight No edit summary |
||
Line 119: | Line 119: | ||
end |
end |
||
local formatted_num; |
local formatted_num = lang:formatNum( math.abs(value) ); |
||
local sign; |
|||
-- Use proper unary minus sign rather than ASCII default |
-- Use proper unary minus sign rather than ASCII default |
||
if value < 0 then |
if value < 0 then |
||
sign = '−'; |
|||
else |
else |
||
sign = ''; |
|||
end |
end |
||
formatted_num = formatted_num .. lang:formatNum( math.abs(value) ); |
|||
local order; |
local order; |
||
Line 141: | Line 141: | ||
order = 0; |
order = 0; |
||
end |
end |
||
formatted_num = sign .. formatted_num; |
|||
-- Pad with zeros, if needed |
-- Pad with zeros, if needed |