xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

Payment()

Calculates a periodical payment for loans.

Syntax

Payment( <nLoan>         , ;
         <nInterestRate> , ;
         <nPeriods>        ) --> nPayment

Arguments

<nLoan>
A numeric value defining the amount of borrowed capital.
<nInterestRate>
This parameter defines a constant interest rate per period during the periods of paying back a loan in the range of 0 to 1 (1 equals 100% interest rate).
<nPeriods>
This is a numeric value defining the number of periods to pay back the loan.

Return

The function returns a numeric value. It is the constant payment necessary to pay back a loan over <nPeriods> amounts of time at a fixed interest rate.

Info

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

Example

// The example calculates the monthly payment required to pay back
// a loan of 10000 units of money over a period of 36 months at an
// interest rate of 8% per year.

   PROCEDURE Main
      LOCAL nLoan       := 10000      // borrowed capital
      LOCAL nInterest   := 0.08/12    // monthly interest rate
      LOCAL nMonths     := 36         // total payback period

      ? Payment( nLoan, nInterest, nMonths )  // result: 313.36

   RETURN

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