From 01dab70fca08b3361a97353700544705d6d707da Mon Sep 17 00:00:00 2001 From: David Cain Date: Sun, 30 Jun 2024 10:05:30 -0600 Subject: [PATCH] Format/align the retirement worth table Align numbers to the right, handle different SWRs and net worth. 7% interest, compounding over many decades makes bigger numbers. Who'd have thought? --- README.md | 10 +++++----- src/main.rs | 4 +++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index bc9275d..4ae8e8b 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/src/main.rs b/src/main.rs index e9a4a78..1447eb9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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))