Anonymous

Module:Calculator/ETA: Difference between revisions

From Melvor Idle
m
Don't show days if daycount = 0
m (Fix incorrect day calculation)
m (Don't show days if daycount = 0)
Line 10: Line 10:
     local days = math.floor(timeInHundredths / (3600000 * 24))
     local days = math.floor(timeInHundredths / (3600000 * 24))


    return string.format("%ddays %02dh %02dm %02ds", days, hrs % 24, min % 60, sec % 60)
local formatString = "%d days %02dh %02dm %02ds"
if days == 0 then
formatString = "%02dh %02dm %02ds"
end
    return string.format(formatString, days, hrs % 24, min % 60, sec % 60)
end
end


2,875

edits