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 cash_flow(rate,nper,pv = 0,fv=0,type =0)
      if(pv > 0)
        pmt = pv / pv_compounding(rate,nper)
      elsif(fv > 0)
        pmt = fv / fv_compounding(rate,nper)
      else
        0
      end
    end
def cash_flow ( rate , nper , pv = 0 , fv = 0 , type = 0 ) if ( pv > 0 ) pmt = pv / pv_compounding ( rate , nper ) elsif ( fv > 0 ) pmt = fv / fv_compounding ( rate , nper ) else 0 end 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 )
rate
nper
pv
fv
type