Modul:Math: Unterschied zwischen den Versionen
keine Bearbeitungszusammenfassung
(deal with unary minus) |
Keine Bearbeitungszusammenfassung |
||
Zeile 119: | Zeile 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 | ||
local order; | local order; | ||
Zeile 141: | Zeile 141: | ||
order = 0; | order = 0; | ||
end | end | ||
formatted_num = sign .. formatted_num; | |||
-- Pad with zeros, if needed | -- Pad with zeros, if needed |