greyhillman / rent-vs-buy

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

Years renting can go negative #1

Closed greyhillman closed 2 years ago

greyhillman commented 2 years ago

Problem

When there's two places to rent, you can increase the first place's years above the number of years being considered. This leads to the last place having negative years.

Reproduction Steps
  1. Add a place
  2. Set years renting of first place to more than the number of years being considered.

Solution

Each place rented should have a maximum for the years it can be rented. The maximum years should be not make the last place go negative.