Here's a small amortization program I wrote that includes source.
It can probably be modified for non-windows use.
https://www.dropbox.com/s/q1p9p1zean6x340/Amortize.zip
blueb
Amortization program (with source)
Amortization program (with source)
- It was too lonely at the top.
System : PB 6.21(x64) and Win 11 Pro (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
System : PB 6.21(x64) and Win 11 Pro (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: Amortization program (with source)
In Canada, most home mortgage loans are paid monthly but compounded semi-anually. I don't see where I can choose compounds per year with your program (which is quite nice btw). If you would like to add compounds/year to it, this is the math I use, sample data provided should yield a monthly payment of $650.81:
Your program yields $665.43, which means you're always compounding monthly.
Code: Select all
p=60000 ; Principal
j.f=0.1275 ; Interest rate
y=25 ; Years of loan
f=12 ; frequency of payments per year (12 for monthly, 52 for weekly, etc.)
m=2 ; compounds per year
a.d = p * (Pow(1+j/m, m/f) - 1) / (1 - Pow(1+j/m,-y*m))
Debug StrD(a,2)
BERESHEIT
Re: Amortization program (with source)
I forgot to allow for our beloved Canadians, who are probably waiting for spring to arrive, and who are as sharp as tacks.
Yes, I'll work on a maple leaf version.
Actually there may be situations where it's feasible to have:
- blended quarterly payments
- blended semi-annual payments (Canada)
- blended annual payments
So the program works for part of the world, until I can make some adjustments.
Funny, I double-checked my results with:
"Loan Payments Handbook" that I've owned forever.
publisher: Computofacts
address: Willowdale, Ontario, Canada

Yes, I'll work on a maple leaf version.
Actually there may be situations where it's feasible to have:
- blended quarterly payments
- blended semi-annual payments (Canada)
- blended annual payments
So the program works for part of the world, until I can make some adjustments.
Funny, I double-checked my results with:
"Loan Payments Handbook" that I've owned forever.
publisher: Computofacts
address: Willowdale, Ontario, Canada

- It was too lonely at the top.
System : PB 6.21(x64) and Win 11 Pro (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
System : PB 6.21(x64) and Win 11 Pro (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem