Sha256: fd4d9d63f011763fdde028fc1cfd7435cb6348fe08ccb3131c0e00cf107075ce

Contents?: true

Size: 396 Bytes

Versions: 3

Compression:

Stored size: 396 Bytes

Contents

# Example showing how to use a single currency.

# USD is the default currency if no configuration is provided
puts Money(10.25).inspect # => 5.125 USD

# Lets switch to other currency
Danconia.configure do |config|
  config.default_currency = 'EUR'
  config.available_currencies = [{code: 'EUR', symbol: '€'}]
end

puts Money(10.25).inspect # => 10.25 EUR
puts Money(10.25).to_s # => €10.25

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
danconia-0.4.0 examples/single_currency.rb
danconia-0.3.1 examples/single_currency.rb
danconia-0.3.0 examples/single_currency.rb