Conversation
| const [interestAmount, setInterestAmount] = useState(0); | ||
| const [totalAmount, setTotalAmount] = useState(0); | ||
| const MAX_YEARS = 240; | ||
| const MAX_PERIODS = 960; // 240 years * 4 quarters (reasonable max) |
There was a problem hiding this comment.
The comment says "240 years × 4 quarters (reasonable max)" — but now that daily and weekly compounding are available, 960 is a very tight ceiling. 960 days is only about 2.6 years. A user selecting Daily and wanting to model 10 years would need to enter 3,650 but can't. The max was designed around quarterly as the most granular option; it needs rethinking now that daily is supported.
There was a problem hiding this comment.
Ok. Thank you for pointing that out. I'll bring it up in our meeting today.
|
@imonroe Can you take a look at this again? The MAX_PERIODS was added by the AI and it was not client requested. I pulled out the MAX_PERIODS. |
imonroe
left a comment
There was a problem hiding this comment.
I made one small change, since the Math.min isn't needed without the MAX_YEARS constant
READY FOR REVIEW
Summary
Review By (Date)
Criticality
Review Tasks
Setup tasks and/or behavior to test
Initial amount: $1,000
Interest rate: 8%
Number of compounding periods: 20
Compounding semi-annually
Final amount: $2,191.12
Currently, if I put the same inputs into the calculator, the final amount is: $4,801.02, which is the output for 20 years (40 semi-annual periods).
Front End Validation
Backend / Functional Validation
Code
Code security
General
Affected Projects or Products
Associated Issues and/or People
@mentionthem here)Resources