Language Reference Guide : 6. Functions : Finance Library Functions : PPMT Function
 
Share this page                  
PPMT Function
The PPMT function calculates the principal portion of a payment for a specified period in the life of a loan, given the amount of the loan and a given rate of interest. Based on same equation as the FV (future value) function (see FV Function).
This function has the following syntax:
PPMT(per = value, pv = value, i = value, nper = value, fv = value, paybegin, byref(context))
Note:  Paybegin is either 1 or 0, indicating that the payment is made at the beginning or end of the period.
Arguments
Data Type
Description
period
Float
Specific period ( 1 - nper )
pv
Float
Present value
i
Float
Interest per period
nper
Integer
Number of periods
fv
Float
Future value
paybegin
Integer
1 = beginning of period
0 = end of period
Default: 0
context
PMT_CONTEXT
Payment context (see following note)
Note:  The context, which is used internally to improve the efficiency of repetitive PPMT calls, must be declared as PMT_CONTEXT and passed using byref().
This function returns:
Float—The principle portion for the specified period
Null—On error
Example—PPMT function:
/*  In the following example period and principle are
**  EntryFields of DataType Float. A specific period
**  would be entered in the period field. There is
**  also a ButtonField named btn_ppmt. The frame
**  script is shown below. The loan is for $10,000
**  for 48 months at 7% interest per year.
*/
on initialize =
declare
    context = PMT_CONTEXT;
enddeclare
on click btn_ppmt =
begin
principal = ppmt(period = period,
pv = 10000,
i = .07/12,
nper = 48,
fv = 0,
paybegin = 0,
context = byref(context));
if principal is NULL then
message 'Failed to calculate principle portion';
endif;
end