Skip to content


Subversion checkout URL

You can clone with
Download ZIP
tag: v1.2.2
Fetching contributors…

Cannot retrieve contributors at this time

72 lines (48 sloc) 1.749 kb


A really simple currency converter using XavierMedia API. Compatible with Ruby 1.8, 1.9, JRuby 1.5.3 and Rubinius 1.1.


Since version 1.2, simple_currency no longer uses Xurrency API in its background, due to restrictions on the number of daily requests. If you would like to use it, please use the fork by Alfonso Jiménez, author and maintainer of service.


Just require it and all your numeric stuff gets this fancy DSL for free:

# => 38.08

# => 190.4
# => 187.98 
# These don't even hit the Internets!
# (They take advantage of Rails cache)

# => 71.9

But what if you want to do the currency exchange according to a specific date in the past? Just do this:

# You can use any time or date object
# => 60.12'2009-09-01')).to_usd
# => 60.12


Rails 3

In your Gemfile:

gem "simple_currency"

Not using Rails?

Then you have to manually install the gem:

gem install simple_currency

And manually require it as well:

require "simple_currency"

Note on Patches/Pull Requests

  • Fork the project.
  • Make your feature addition or bug fix.
  • Add specs for it. This is important so I don't break it in a future version unintentionally.
  • Commit, do not mess with rakefile, version, or history. If you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull.
  • Send me a pull request. Bonus points for topic branches.


Copyright (c) 2010 Codegram. See LICENSE for details.

Jump to Line
Something went wrong with that request. Please try again.