Sha256: 9e21112971b472453701779d6ec2756216f5d680179f1f07efb2444688f9e62b

Contents?: true

Size: 256 Bytes

Versions: 2

Compression:

Stored size: 256 Bytes

Contents

module Papla
  class MoneyConverter < FloatConverter
    def convert(number)
      append_currency(super(number.to_f.round(2)), number)
    end

    private

    def append_currency(phrase, money)
      '%s %s' % [phrase, money.currency]
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
papla-0.2.1 lib/papla/money_converter.rb
papla-0.2.0 lib/papla/money_converter.rb