Class: Numeric
- Inherits:
-
Object
- Object
- Numeric
- Defined in:
- lib/lib/util.rb
Instance Method Summary collapse
Instance Method Details
#from_c ⇒ Object
45 46 47 |
# File 'lib/lib/util.rb', line 45 def from_c (self.to_f / 100) end |
#to_b ⇒ Object
49 50 51 |
# File 'lib/lib/util.rb', line 49 def to_b return (not (self.zero?)) end |
#to_c ⇒ Object
41 42 43 |
# File 'lib/lib/util.rb', line 41 def to_c (self.to_f * 100).round.to_i end |