Module:Calculator/ETA: Difference between revisions

m
Fix incorrect day calculation
m (Correct calling non-existent function)
m (Fix incorrect day calculation)
Line 8: Line 8:
     local min = math.floor(timeInHundredths / 60000)
     local min = math.floor(timeInHundredths / 60000)
     local hrs = math.floor(timeInHundredths / 3600000)
     local hrs = math.floor(timeInHundredths / 3600000)
     local days = math.floor(timeInHundredths / 3600000 * 24)
     local days = math.floor(timeInHundredths / (3600000 * 24))


     return string.format("%d-%02d:%02d:%02d", days, hrs % 24, min % 60, sec % 60)
     return string.format("%ddays %02dh %02dm %02ds", days, hrs % 24, min % 60, sec % 60)
end
end


2,875

edits