Sha256: d76274339406c9f1eac134b83268983660fb56ff11df202e0f2039571004d6e8

Contents?: true

Size: 413 Bytes

Versions: 6

Compression:

Stored size: 413 Bytes

Contents

require 'danconia'

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

# 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

6 entries across 6 versions & 1 rubygems

Version Path
danconia-0.2.8 examples/single_currency.rb
danconia-0.2.7 examples/single_currency.rb
danconia-0.2.6 examples/single_currency.rb
danconia-0.2.5 examples/single_currency.rb
danconia-0.2.4 examples/single_currency.rb
danconia-0.2.3 examples/single_currency.rb