File: base.rb

package info (click to toggle)
ruby-roo 3.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 8,216 kB
  • sloc: ruby: 6,529; xml: 88; makefile: 6
file content (15 lines) | stat: -rw-r--r-- 378 bytes parent folder | download | duplicates (5)
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