xHarbour Reference Documentation > Function Reference |
Calculates the present value of future capital, based on periodic investments.
Pv( <nInvestment> , ; <nInterestRate> , ; <nPeriods> ) --> nPresentValue
The function returns the present value of a periodic, constant investment at a constant interest rate over a period of time as a numeric value.
See also: | Fv(), Payment(), Periods(), Rate() |
Category: | CT:Math , Financial functions , Mathematical functions |
Source: | ct\finan.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example calculates the present value of monthly investments of 100 units // of money over a period of 48 months at an interest rate of 5% per year. // (potential savings with interest) PROCEDURE Main LOCAL nInvestment := 100 // monthly savings LOCAL nInterest := 0.05/12 // monthly interest rate LOCAL nMonths := 48 // total savings period ? Pv( nInvestment, nInterest, nMonths ) // result: 4342.30 RETURN
http://www.xHarbour.com