This simple gem makes it easy to calculate how much different amounts of money would be worth in certain years. Years from 1800 - 2012 are supported.
Add this line to your application's Gemfile:
gem 'inflation'
And then execute:
$ bundle
Or install it yourself as:
$ gem install inflation
require 'inflation'
# Return the value (rounded to 2 decimal points)
1.from(1800).to(2012)
# Or, if you like more English sounding method chaining...
1.from_1800.to_2012
# Even better, you can use from_now and to_now instead of the year
1.from_now.to_2010
1.from_1898.to_now
# Return true if the year is supported.
1840.year?
=> true
1784.year?
=> false
- 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