xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

Rate()

Calculates the interest rate for a loan.

Syntax

Rate( <nLoan>, <nPayment>, <nPeriods> ) --> nInterestRate

Arguments

<nLoan>
A numeric value defining the amount of the loan.
<nPayment>
A numeric value defining the constant, payback amount.
<nPeriods>
This is a numeric value defining the number of periods during which the loan is payed back.

Return

The function returns the interest rate for a loan at constant payments over a period of time as a numeric value.

Info

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

Example

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

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