Introduction | Demonstration Calculator | Source Code

## How The Mortgage Calculator with Amortization Works

This calculator uses the same mathematical functions as our Simple Mortgage Payment Calculator, but creates a loop, going through all the months and calculating the interest to principal ratios for each payment as you pay down the principal each month.

The amortization display is very simple. The output for each month is generated by one line of code…

```
factsout += '<b>Year ' + (inyear + 1) + ' Month ' + (inmonth +1) + ':</b><br> Principal Paid: $' + princpaid + '<br> Interest Paid: $' + intpaid + '<br> Principal Remaining: $' + loan + '<br>';
```

If you’re familiar with HTML and just have a basic knowledge of JavaScript, you can edit that to add all sorts of formatting goodness to your output.

Introduction | Demonstration Calculator | Source Code