Skip to content

Commit

Permalink
Format/align the retirement worth table
Browse files Browse the repository at this point in the history
Align numbers to the right, handle different SWRs and net worth.

7% interest, compounding over many decades makes bigger numbers.
Who'd have thought?
  • Loading branch information
DavidCain committed Jun 30, 2024
1 parent db6d801 commit 01dab70
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ REIT: $3,080 (🎯 8.03%)
Portfolio total: $28,686
Worth at retirement (Assuming 7% growth):
- 39: $28,686 SWR: $1,147
- 50: $58,391 SWR: $2,336
- 55: $81,893 SWR: $3,276
- 60: $114,875 SWR: $4,595
- 65: $161,111 SWR: $6,444
- 39: $28,686 SWR: $1,147
- 50: $58,391 SWR: $2,336
- 55: $81,893 SWR: $3,276
- 60: $114,875 SWR: $4,595
- 65: $161,111 SWR: $6,444
After-tax income: $49,700
Charitable giving: $5,000 (10% of after-tax income)
Expand Down
4 changes: 3 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ fn summarize_retirement_prospects(birthday: NaiveDate, portfolio_total: Decimal,
// TODO: Correctly calculate age instead of this cheap approximation
let retirement_age = day_of_retirement.year() - birthday.year();
println!(
" - {}: {:} SWR: {:}",
// Neatly displays net worth up to $25MM
// If your assets are that high, why are you running this jank?
" - {}: {: >11} SWR: {: >9}",
retirement_age,
decutil::format_dollars(&future_total),
decutil::format_dollars(&compounding::safe_withdrawal_income(future_total))
Expand Down

0 comments on commit 01dab70

Please sign in to comment.