HP Prime and fx-CG 50: Percentage of a Mortgage Paid
Introduction
The program PERMORTGAGE for the HP Prime, and PERMORT for the Casio fx-CG 50 calculates the percentage of mortgage paid off any time during the mortgage’s term.
Inputs:
N = The length of the mortgage (or loan) in number of monthly payments. The payments are assumed to be made at the end of the month.
R = The annual rate of the mortgage. Assume that this loan is fixed.
L = The amount of the loan.
D = The number of payments already made.
Assume that there is no balloon payment.
The % of mortgage paid is calculated by the following steps:
Step 1: Let P by the monthly payment: P = PMT(N, R, L, 0, 12, 12)
(the last two arguments are payments per year and compounding periods per year, both set at 12)
Both calculators featured use the cash flow convention. That is, all cash inflows (receipts) are positive and cash outflows (payments) are negative. In this case, the monthly payment (P) and balance remaining (B) are negative.
Step 2: Let B be the approximate balance using the FV (future value) function:
B = FV(D, R, L, P, 12, 12)
Step 3: Calculate the % of mortgage paid:
T = (1 + B / L ) * 100%
HP Prime Program Code: PERMORTGAGE
Syntax: PERMORTGAGE( nterm, rate, loan, npaid )
nterm = number of monthly payments for the entire term. Example for a 30 year term, nterm = 360
rate = annual rate of a mortgage
loan = loan amount
npaid = number of payments made
Result: % of the principal paid
Code:
EXPORT PERMORTGAGE(nt,rate,loan,np)
BEGIN
// n term, rate, loan,,n paid
// Percent of a Mortgage Paid
// Monthly payments assumed, end mode assumed
// Assume no balloon payment
// EWS 2024-11-01
LOCAL pymt,prct,baln;
pymt:=Finance.TvmPMT(nt,rate,loan,0,12,12);
baln:=Finance.TvmFV(np,rate,loan,pymt,12,12);
// PMT and FV will be negative
prct:=(1+baln/loan)*100;
RETURN prct;
END;
Casio fx-CG 50 Program: PERMORT
The program asks for a single calculation or range of calculations which is stored in Matrix Mat A. (The first row is has two zeros, and is used as a “header”.) The first column is the number of payments made, the second is the percentage of mortgage (loan) paid.
Code:
PmtEnd
“N (TERM)”? → N
“RATE”? → R
“LOAN AMT”? → L
Menu “TYPE”,”SINGLE”,1,”RANGE”,2
Lbl 1
Cmpd_PMT(N,R,L,0,12,12) → P
Cmpd_FV(D,R,L,P,12,12) → B
(1+B÷L)×100 → T
“PERCENT PAID =”
T
Stop
Lbl 2
“N1”? → A
“N2”? → B
“STEP”? → C
[ [ 0 ] [ 0 ] ] → Mat A
For A → D To B Step C
Cmpd_PMT(N,R,L,0,12,12) → P
Cmpd_FV(D,R,L,P,12,12) → B
(1+B÷L)×100 → T
Augment(Mat A, [ [ D ] [ T ] ]) → Mat A
Next
Trn Mat A → Mat A
“IGNORE TOP ROW - “
“ [ N PER ]” ◢
Mat A
Stop
Example
$100,000 loan over 30 years (360 payments). Screen shots were taking with the HP Prime emulator.
Note that the % paid takes on a curve, the later we get into the term, the more principal is paid off. This program can be a demonstration of how amortization works.
Until next time,
Eddie
All original content copyright, © 2011-2025. Edward Shore. Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited. This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.