Module: Roo::Formatters::Base

Included in:
Base
Defined in:
lib/roo/formatters/base.rb

Instance Method Summary collapse

Instance Method Details

#integer_to_timestring(content) ⇒ Object

converts an integer value to a time string like ‘02:05:06’



5
6
7
8
9
10
11
12
# File 'lib/roo/formatters/base.rb', line 5

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