Module:Infobox interval: Difference between revisions
revert |
changed the cents value display to hundredth of a cent precision because millionths of a cent is too much clutter |
||
| Line 172: | Line 172: | ||
end | end | ||
if regular then | if regular then | ||
-- a hundredth of a cent precision, and 3 significant figures if < 1¢ | |||
local sigFigs = 3 | |||
if cents >= 10 then sigFigs = 4 end | |||
if cents >= 100 then sigFigs = 5 end | |||
if cents >= 1000 then sigFigs = 6 end | |||
table.insert(infobox_data, { | |||
"Size in [[cent]]s", | |||
utils._round(cents, sigFigs) .. "¢", | |||
}) | |||
table.insert(infobox_data, { | table.insert(infobox_data, { | ||
"Size in [[cent]]s", | "Size in [[cent]]s", | ||