| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Calculates a periodical payment for loans.
Payment( <nLoan> , ;
<nInterestRate> , ;
<nPeriods> ) --> nPayment
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.
| See also: | Fv(), Periods(), Pv(), Rate() |
| Category: | CT:Math , Financial functions , Mathematical functions |
| Source: | ct\finan.c |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// 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
http://www.xHarbour.com