Class: GenesisRuby::Utils::Money::Conversions::ExponentToAmount
- Inherits:
-
Base::Strategy
- Object
- Base::Strategy
- GenesisRuby::Utils::Money::Conversions::ExponentToAmount
- Defined in:
- lib/genesis_ruby/utils/money/conversions/exponent_to_amount.rb
Overview
Amount To Exponent Money Conversion Strategy
Instance Attribute Summary
Attributes inherited from Base::Strategy
#amount, #currency, #currency_exponent
Instance Method Summary collapse
-
#convert ⇒ Object
Convert ISO-4217 minor currency unit to amount.
Methods inherited from Base::Strategy
Constructor Details
This class inherits a constructor from GenesisRuby::Utils::Money::Base::Strategy
Instance Method Details
#convert ⇒ Object
Convert ISO-4217 minor currency unit to amount
13 14 15 16 17 18 |
# File 'lib/genesis_ruby/utils/money/conversions/exponent_to_amount.rb', line 13 def convert format( "%.#{currency_exponent}f", (amount / parse_amount(10**currency_exponent)).truncate(currency_exponent) ) end |