Sha256: cf02081048a00ebb2f3af1bf5ff269812325c6e736a113923cc58dc5537ef303

Contents?: true

Size: 508 Bytes

Versions: 11

Compression:

Stored size: 508 Bytes

Contents

require 'genesis_ruby/utils/money/base/strategy'

module GenesisRuby
  module Utils
    module Money
      module Conversions
        # Amount To Exponent Money Conversion Strategy
        class AmountToExponent < GenesisRuby::Utils::Money::Base::Strategy

          # Convert amount to ISO-4217 minor currency unit
          def convert
            format(
              '%d',
              (amount * parse_amount(10**currency_exponent))
            )
          end

        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
genesis_ruby-0.2.0 lib/genesis_ruby/utils/money/conversions/amount_to_exponent.rb
genesis_ruby-0.1.9 lib/genesis_ruby/utils/money/conversions/amount_to_exponent.rb
genesis_ruby-0.1.8 lib/genesis_ruby/utils/money/conversions/amount_to_exponent.rb
genesis_ruby-0.1.7 lib/genesis_ruby/utils/money/conversions/amount_to_exponent.rb
genesis_ruby-0.1.6 lib/genesis_ruby/utils/money/conversions/amount_to_exponent.rb
genesis_ruby-0.1.5 lib/genesis_ruby/utils/money/conversions/amount_to_exponent.rb
genesis_ruby-0.1.4 lib/genesis_ruby/utils/money/conversions/amount_to_exponent.rb
genesis_ruby-0.1.3 lib/genesis_ruby/utils/money/conversions/amount_to_exponent.rb
genesis_ruby-0.1.2 lib/genesis_ruby/utils/money/conversions/amount_to_exponent.rb
genesis_ruby-0.1.1 lib/genesis_ruby/utils/money/conversions/amount_to_exponent.rb
genesis_ruby-0.1.0 lib/genesis_ruby/utils/money/conversions/amount_to_exponent.rb