lib/finance/annuity.rb
##
# Determine the future value of an asset with 
# reguar payments
# rate - interest rate per period
# nper - number of periods or duration
# pmt - per period contribution
# pv present value
# type - 
#     0:  end of period payments (ordinary annuity)
#     1:  beginning of period payments (annuity due)
#
Determine the future value of an asset with
reguar payments
rate - interest rate per period
nper - number of periods or duration
pmt - per period contribution
pv present value
type
0:  end of period payments (ordinary annuity)
1:  beginning of period payments (annuity due)
Determine the future value of an asset with reguar payments rate - interest rate per period nper - number of periods or duration pmt - per period contribution pv present value type 0 : end of period payments ( ordinary annuity ) 1 : beginning of period payments ( annuity due )
def future_value(rate,nper,pmt,pv = 0,type = 0)
      fv = pmt * fv_compounding(rate,nper)
      fvii = pv * (1+rate)**nper
      fv + fvii
    end
def future_value ( rate , nper , pmt , pv = 0 , type = 0 ) fv = pmt * fv_compounding ( rate , nper ) fvii = pv * ( 1 + rate ) ** nper fv + fvii end
Determine the future value of an asset with
reguar payments
rate - interest rate per period
nper - number of periods or duration
pmt - per period contribution
pv present value
type 
0:  end of period payments (ordinary annuity)
1:  beginning of period payments (annuity due)
Determine the future value of an asset with reguar payments rate - interest rate per period nper - number of periods or duration pmt - per period contribution pv present value type 0 : end of period payments ( ordinary annuity ) 1 : beginning of period payments ( annuity due )
#calculate the fv of the payments #calculate the fv of the initial investment
rate
nper
pmt
pv
type