ECB::CurrencyConverter
Currency Conversion using the European Central Bank's Euro foreign exchange reference rates.
Installation
Add this line to your application's Gemfile:
gem 'ecb-currency_converter'
And then execute:
$ bundle
Or install it yourself as:
$ gem install ecb-currency_converter
Usage
To convert between two currencies:
ECB::CurrencyConverter.exchange(100, 'EUR', 'USD')
=> 133.73999999999998
ECB::CurrencyConverter.exchange(100, 'USD', 'EUR')
=> 74.77194556602363
To get the most recent exchange rate between two currencies:
ECB::CurrencyConverter.rate('EUR', 'USD')
=> 1.3374
ECB::CurrencyConverter.rate('USD', 'EUR')
=> 0.7477194556602363
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request