Module:Infobox interval: Difference between revisions

TallKite (talk | contribs)
fixed a bug
TallKite (talk | contribs)
made an exception for 4/3 and 3/2, they get thousandths of a cent
Line 173: Line 173:
if regular then
if regular then
-- a hundredth of a cent precision, and 3 significant figures if < 1¢
-- a hundredth of a cent precision, and 3 significant figures if < 1¢
-- but 3/2 and 4/3 get thousandths of a cent, since they get stacked a lot
local sigFigs = 3
local sigFigs = 3
if cents >= 10 then sigFigs = 4 end
if cents >= 10 then sigFigs = 4 end
if cents >= 100 then sigFigs = 5 end
if cents >= 100 then sigFigs = 5 end
if cents >= 1000 then sigFigs = 6 end
if cents >= 1000 then sigFigs = 6 end
if cents > 701.955 and cents < 701.955002 then sigFigs = 6 end
if cents < 498.045 and cents > 498.044998 then sigFigs = 6 end
table.insert(infobox_data, {
table.insert(infobox_data, {
"Size in [[cent]]s",
"Size in [[cent]]s",