Class: Numeric
- Inherits:
-
Object
- Object
- Numeric
- Defined in:
- lib/money/core_extensions.rb
Instance Method Summary collapse
-
#to_money ⇒ Object
Converts this numeric to a Money object in the default currency.
Instance Method Details
#to_money ⇒ Object
Converts this numeric to a Money object in the default currency. It multiplies the numeric value by 100 and treats that as cents.
100.to_money => #<Money @cents=10000>
100.37.to_money => #<Money @cents=10037>
7 8 9 |
# File 'lib/money/core_extensions.rb', line 7 def to_money Money.new(self * 100) end |