Class: Numeric

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

Instance Method Summary collapse

Instance Method Details

#from_cObject



45
46
47
# File 'lib/lib/util.rb', line 45

def from_c
  (self.to_f / 100)
end

#to_bObject



49
50
51
# File 'lib/lib/util.rb', line 49

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

#to_cObject



41
42
43
# File 'lib/lib/util.rb', line 41

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