Mortgage calculator code
Part 1
|
The heart of the calculator code is the mortgage formula:
Pa = PrValue x IntRate / (1 – (1 + IntRate)–Period)
Where Pa is the payment, PrValue the present value of the loan, IntRate the interest rate and Period, the number of years you are borrowing the money.
Knowing the mortgage formula is one thing. It's all the other details that make it hard to do... form validation, input transformation, etc. Therefore, it's not that easy to program a JavaScript mortgage calculator... because a lot of small details are involved.
For a very basic example of code that you can use right away, go to this JavaScript mortgage calculator page.
As I said earlier, it's easy and at the same time it's not easy.
It would be easy if all we had to do was to program the mortgage formula in JavaScript. Much more is involved than just the formula code. In order to code a good calculator, you also need sub-routines that validate the entered data, that show the results with the good values (2 decimal places, percent sign), etc. It's mainly a question of interface and data validation.
In part 2 of this mortgage calculator code series you will discover:
How do we code the mortgage formula? The basic JavaScript mortgage formula code and more.
To complicated? Just click here to purchase ready-to-use JavaScript mortgage calculators that you can install on your website or for offline use on your computer!
Mortgage Calculators Products Services Help About Us Site Map
© Copyright (C) 2003-2010 by Dominique Peladeau • 1stop-mortgagecalculator.com.
All Rights Reserved
886 de L'Epee ave., Outremont, QC, H3V 3V3 • (514) 571-9747 (9-5 EST)
Contact us