Module:Time ago: Difference between revisions

see if we can do away with all of those math.floor calls
(Indent if statements. Blocks inside if statements have lexical scope, so it is a lot clearer which block has which scope if you indent. (Also see Wikipedia:Lua style guide.))
(see if we can do away with all of those math.floor calls)
Line 43:
else
-- Calculate the appropriate unit of time if it was not specified as an argument.
if math.floor( absTimeDiff / 120 ) >= 01 then
auto_magnitude_num = 60
else
auto_magnitude_num = 1
end
if math.floor( absTimeDiff / 7200 ) >= 01 then
auto_magnitude_num = 3600
end
if math.floor( absTimeDiff / 172800 ) >= 01 then
auto_magnitude_num = 86400
end
if math.floor( absTimeDiff / 5356800 ) >= 01 then
auto_magnitude_num = 2678400
end
if math.floor( absTimeDiff / 63115200 ) >= 01 then
auto_magnitude_num = 31557600
end