chris1610 / pbpython

Code, Notebooks and Examples from Practical Business Python
https://pbpython.com
BSD 3-Clause "New" or "Revised" License
1.99k stars 987 forks source link

rounding error #12

Open AlJohri opened 6 years ago

AlJohri commented 6 years ago

hey @chris1610, great article and notebook on mortgage / ammortization. I noticed that you rounded the np.pmt which sometimes throws off the number of payments. for example I was doing a 3.875% interest, 30 year, 427500 principal and I got 361 periods instead of 360. removing the rounding fixed the error.

in addition, it would be cool if you added support for PMI, property tax, and home insurance to show the total out of pocket expense in another column

thanks!

update: in addition to removing the rounding, I found i also had to add: while round(end_balance, 5) > 0: