Module:Infobox interval: Difference between revisions

ArrowHead294 (talk | contribs)
mNo edit summary
TallKite (talk | contribs)
reduced the cents' decimal places to something reflecting what humans can actually hear lol
Line 172: Line 172:
end
end
if regular then
if regular then
-- it's really hard to hear a tenth of a cent, but 3 sig figs seems possibly useful
local decimalPlaces = 0
if cents < 100 then decimalPlaces = 1 end
if cents < 10 then decimalPlaces = 2 end
if cents < 1 then decimalPlaces = 3 end
table.insert(infobox_data, {
table.insert(infobox_data, {
"Size in [[cent]]s",
"Size in [[cent]]s",
utils._round(cents, 8) .. "¢",
utils._round(cents, decimalPlaces) .. "¢",
})
})
end
end