xHarbour Reference Documentation > Function Reference |
Calculates the duration for paying back a loan at fixed interest rate and payments.
Periods( <nLoan> , ; <nPayBack> , ; <nInterestRate> ) --> nDuration
The function returns a numeric value. It is the number or periods (the duration) a loan must be payed back at fixed payments and fixed interest rate.
See also: | Fv(), Payment(), Pv(), Rate() |
Category: | CT:Math , Financial functions , Mathematical functions |
Source: | ct\finan.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example calculates the duration of a payback period for // a loan in months. Monthly payment to pay back a loan of 10000 // units of money is set at 200 units of money. Interest rate is // 8% per year. PROCEDURE Main LOCAL nLoan := 10000 // borrowed capital LOCAL nPayback := 200 // payback units of money per month LOCAL nInterest := 0.08/12 // monthly interest rate ? Periods( nLoan, nPayback, nInterest ) // result: 61.02 (months) RETURN
http://www.xHarbour.com