0.0
No commit activity in last 3 years
No release in over 3 years
It's 2019. Those other inflation-calculating gems haven't been updated since 2014.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.0
~> 10.0
~> 3.0
 Project Readme

InflationDb

InflationDb allows you to take a dollar amount from any year between 1635 and 2018 and find that amount adjusted for inflation in 2019.

Installation

Add this line to your application's Gemfile:

gem 'inflation_db'

And then execute:

$ bundle

Or install it yourself as:

$ gem install inflation_db

Usage

To calculate inflation on an amount from 1635-2018 to 2019, add this line to your code:

calculate_inflation(year_of_original_amount, that_original_amount)

and the method will return a float rounded to two decimal places.

To calculate inflation on an amount from 1635-2019 to any other year 1635, add this line to your code:

calculate_inflation(year_of_original_amount, that_original_amount, year_of_new_amount)

Examples:

  • to calculate inflation on $10 from 1776 to 2019, you can write

calculate_inflation(1776, 10)

or

calculate_inflation(1776, 10, 2019)

  • to calculate inflation on $10 from 1776 to 1980, you would write

calculate_inflation(1776, 10, 1980)

  • to calculate what $100 in 2019 would have been worth in 1888, you would write

calculate_inflation(2019, 100, 1888)

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/dybushnell/inflation_db. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

Acknowledgments

I would like to thank Nick Stano for his guidance and assistance. I would also like to thank the Flatiron School, Tashawn Williams, Brianna Dixon, and Jeff Hwang.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the InflationDb project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.