blob: 2d32d6d93fbbc53f0004c204d12a59b8a10fe72a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
module Roo
module Formatters
module Base
# converts an integer value to a time string like '02:05:06'
def integer_to_timestring(content)
h = (content / 3600.0).floor
content -= h * 3600
m = (content / 60.0).floor
content -= m * 60
s = content
Kernel.format("%02d:%02d:%02d", h, m, s)
end
end
end
end
|