Project

time_value

0.0
No commit activity in last 3 years
No release in over 3 years
Perform time value of money calculations using financial calculator variables n, i, PV, PMT, and FV
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 3.7
 Project Readme

CircleCI Gem Version Code Climate

Time Value of Money calculator

Performs financial calculations for:

  • n (number of periods)
  • pv (present value)
  • pmt (payment amount)
  • fv (future value)
  • i (interest rate)

NOTE: Only supports annuity due.

Usage

Install the gem:

gem install time_value

Initialize with values:

time_value = TimeValue.new(n, i, pv, pmt, fv)

Or set values after initialization:

time_value = TimeValue.new()
time_value.n = my_n
time_value.i = my_i
time_value.pv = my_pv
time_value.pmt = my_pmt
my_fv = time_value.calc_fv()

Remember to follow a convention for signs of values:

  • Money being paid should have a negative value (-)
  • Money being received should have a positive value (+)

Failing to follow this convention may yield unexpected results