Class: Numeric

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

Instance Method Summary collapse

Instance Method Details

#from_cObject



51
52
53
# File 'lib/lib/util.rb', line 51

def from_c
  (self.to_f / 100)
end

#to_bObject



55
56
57
# File 'lib/lib/util.rb', line 55

def to_b
  return (not (self.zero?))
end

#to_cObject



47
48
49
# File 'lib/lib/util.rb', line 47

def to_c
  (self.to_f * 100).round.to_i
end