Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/currency_math.rb
Instance Method Summary collapse
Instance Method Details
#abs ⇒ Object
31 32 33 |
# File 'lib/currency_math.rb', line 31 def abs split('-').last end |
#with_trailing_zeros ⇒ Object
25 26 27 28 29 |
# File 'lib/currency_math.rb', line 25 def with_trailing_zeros s = split('.') s.last << '0' while s.last.size < 2 && s.size > 1 s.join('.') end |