mirror of https://github.com/ghostfolio/ghostfolio
Browse Source
The zero-interest (r === 0) branch of calculatePeriodsToRetire returned a negative number of periods when the FIRE goal was already met (totalAmount <= P), since the already-met guard only existed on the r !== 0 branch. This rendered a past/invalid retirement date. Clamp the zero-interest result with Math.max(0, ...) so it can never go negative, mirroring the existing guard's behavior on the other branch.pull/7069/head
3 changed files with 34 additions and 1 deletions
Loading…
Reference in new issue