Module:Math: Difference between revisions

deal with unary minus
en>Dragons flight
m (really fix trailing periods)
en>Dragons flight
(deal with unary minus)
Line 119:
end
local formatted_num = lang:formatNum( value );
-- Use proper unary minus sign rather than ASCII default
if value < 0 then
formatted_num = '−';
else
formatted_num = '';
end
formatted_num = formatted_num .. lang:formatNum( math.abs(value) );
local order;
Line 148 ⟶ 157:
-- Add exponential notation, if necessary.
if order ~= 0 then
-- Use proper unary minus sign rather than ASCII default
formatted_num = formatted_num .. '<span style="margin:0 .15em 0 .25em">×</span>10<sup>' .. lang:formatNum(order) .. '</sup>'
if order < 0 then
order = '−' .. lang:formatNum( math.abs(order) );
else
order = lang:formatNum( order );
end
formatted_num = formatted_num .. '<span style="margin:0 .15em 0 .25em">×</span>10<sup>' .. lang:formatNum(order) .. '</sup>'
end
Anonymous user