Module:TimeSpan: Difference between revisions

m
Small fix to toStringLong
m (Correct toStringLong missing milliseconds)
m (Small fix to toStringLong)
 
Line 116: Line 116:
return string.format('0 seconds')
return string.format('0 seconds')
end
end
-- Special case to show actiontime related numbers.
return string.format('%.1f seconds', totalSeconds)
return string.format('%.2f seconds', totalSeconds)
end
end


Line 138: Line 138:
end
end
if seconds > 0 then
if seconds > 0 then
table.insert(output, string.format('%d second%s', seconds, (seconds > 1) and "s" or ""))
table.insert(output, string.format('%.2f second%s', seconds, (seconds > 1) and "s" or ""))
end
end
if milliseconds > 0 then
 
table.insert(output, string.format('%d milliseconds%s', milliseconds, (milliseconds > 1) and "s" or ""))
end
return table.concat(output, ", ")
return table.concat(output, ", ")
end
end
915

edits