Class: Fixnum

Inherits:
Object
  • Object
show all
Defined in:
lib/core_ext/fixnum.rb

Constant Summary collapse

DEFAULT_ROUNDING =
0.25

Instance Method Summary collapse

Instance Method Details

#to_hours(round = nil) ⇒ Object



4
5
6
7
8
# File 'lib/core_ext/fixnum.rb', line 4

def to_hours(round=nil)
  round ||= DEFAULT_ROUNDING

  ((self / 3600000.0) / round).round  * 0.25
end