greyhillman / rent-vs-buy

https://greyhillman.github.io/rent-vs-buy/
GNU Affero General Public License v3.0
0 stars 0 forks source link

Buying goes NaN when there's no mortgage left to pay #2

Closed greyhillman closed 3 years ago

greyhillman commented 3 years ago

Problem

When the years being considered is greater than the length of the mortgage, the buying profit/equity returns NaN.

Reproduction Steps
  1. Set mortgage length to 25 (this is the default)
  2. Set years being considered to 26.

Solution

There should be no monthly payments for the mortgage nor any mortgage liability left. The profit/equity should return a number.