Savings calculator: improve reached-goal behavior and goal timing - #185
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR improves the Savings calculator’s handling of reached goals, zero-interest calculations, compounding-only growth, partial periods, and year-by-year results.
https://stanfordits.atlassian.net/browse/IFDM-172
https://stanfordits.atlassian.net/browse/IFDM-347
Changes
-when the current balance meets or exceeds the goal.$0.00when compounding alone will reach the goal.0.8or4.5.Human QA scenarios
1. Goal already reached
On the Savings tab, enter:
$1,000$1,200Expected:
-.-.2. Zero-interest calculation
Enter:
$12,000$01 year0%MonthlyExpected:
$1,000.00$12,000.00$0.003. Compounding reaches the goal without contributions
Enter:
$1,000$99010 years5%MonthlyExpected:
$0.003 months.0.2and ends at$1,000.00.4. Partial-year breakdown
Enter a Savings scenario lasting:
4 years6 monthsExpected:
1,2,3,4, and4.5.4.5.Also test a ten-month scenario and confirm the final year displays as
0.8.5. Whole contribution-period timing
On Time to Goal, enter:
$1,000$0$3000%MonthlyExpected:
0 years 4 months$1,000.00$0.00$100, rather than another full$300.$1,000.00.6. Partial compounding period
On Savings, enter:
$1,000$5006 months10%AnnuallyExpected:
$475.60$975.60$24.400.5.$1,000.00.Regression checks
Verification completed
yarn lintcompletes with the existingisOverflowdependency warning.yarn build:localpasses.Scope note
The unreproduced review findings numbered #1 and #3 were not changed in this PR.