| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Calculates the interest rate for a loan.
Rate( <nLoan>, <nPayment>, <nPeriods> ) --> nInterestRate
The function returns the interest rate for a loan at constant payments over a period of time as a numeric value.
| See also: | Fv(), Payment(), Periods(), Pv() |
| Category: | CT:Math , Financial functions , Mathematical functions |
| Source: | ct\finan.c |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// The example calculates the effective interest rate for a loan of 10000
// units of money that is payed back in 36 months with maonthly payments of
// 312 units of money.
PROCEDURE Main
LOCAL nLoan := 10000 // borrowed capital
LOCAL nPayment := 312 // payback units of money per month
LOCAL nMonths := 36 // months to pay
? Rate( nLoan, nPayment, nMonths ) * 12 // result: 0.08 (8% interest)
RETURN
http://www.xHarbour.com