xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

Pv()

Calculates the present value of future capital, based on periodic investments.

Syntax

Pv( <nInvestment>   , ;
    <nInterestRate> , ;
    <nPeriods>        ) --> nPresentValue

Arguments

<nInvestment>
A numeric value defining the periodic investment.
<nInterestRate>
This parameter defines a constant interest rate per period during the periods of the investment in the range of 0 to 1 (1 equals 100% interest rate).
<nPeriods>
This is a numeric value defining the number of periods to include in the calculation.

Return

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.

Info

See also:Fv(), Payment(), Periods(), Rate()
Category: CT:Math , Financial functions , Mathematical functions
Source:ct\finan.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// 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

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe