Click or drag to resize

Payment Function

X#
Returns the amount of each periodic payment on a fixed-interest loan.

Namespace:  XSharp.VFP
Assembly:  XSharp.VFP (in XSharp.VFP.dll) Version: 2.19
Syntax
 FUNCTION Payment(
	nPrincipal AS FLOAT,
	nInterestRate AS FLOAT,
	nPayments AS FLOAT
) AS FLOAT
Request Example View Source

Parameters

nPrincipal
Type: Float
Specifies the beginning principal of the loan.
nInterestRate
Type: Float
Specifies the fixed interest rate per period. If monthly payments are made on the loan but the interest rate is annual, divide the annual interest rate by 12.
nPayments
Type: Float
Specifies the total number of payments to be made on the loan.

Return Value

Type: Float
Numeric
Remarks
Payment( ) assumes a constant periodic interest rate and assumes that payments are made at the end of each period.
Examples
X#
1STORE 100000 to gnPrincipal     // $100,000 beginning principal
2STORE .105/12 TO gnInterest  // 10.5% annual interest rate
3STORE (20*12) TO gnPayments     // 20 years of monthly payments
4Clear
5? Payment(gnPrincipal, gnInterest, gnPayments)  // Displays 998.38
See Also