2,875
edits
m (Allow currentExp to be entered with a suffix) |
m (Use timespan from Module:Numbers) |
||
Line 4: | Line 4: | ||
local number = require('Module:Number') | local number = require('Module:Number') | ||
function p.formatTime(timeInHundredths) | |||
local timespan = number.secondsToTimeSpan(timeInHundredths / 100) | |||
if days == 0 then | if timespan.days == 0 then | ||
return string.format("%02dh %02dm %02ds", | return string.format("%02dh %02dm %02ds", timespan.hours, timespan.minutes, timespan.seconds) | ||
else | else | ||
return string.format("%d days %02dh %02dm %02ds", days, | return string.format("%d days %02dh %02dm %02ds", timespan.days, timespan.hours, timespan.minutes, timespan.seconds) | ||
end | end | ||
end | end |
edits