Modul:Math: Unterschied zwischen den Versionen
deal with unary minus
K (really fix trailing periods) |
(deal with unary minus) |
||
Zeile 119: | Zeile 119: | ||
end | end | ||
local formatted_num = lang:formatNum( value ); | local formatted_num; | ||
-- 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; | local order; | ||
Zeile 148: | Zeile 157: | ||
-- Add exponential notation, if necessary. | -- Add exponential notation, if necessary. | ||
if order ~= 0 then | if order ~= 0 then | ||
formatted_num = formatted_num .. '<span style="margin:0 .15em 0 .25em">×</span>10<sup>' .. | -- Use proper unary minus sign rather than ASCII default | ||
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>' .. order .. '</sup>' | |||
end | end | ||