fix breakeven to compare against after-tax renter portfolio
This commit is contained in:
9
calc.js
9
calc.js
@@ -119,12 +119,9 @@ function run_simulation(p) {
|
||||
const selling_costs = home_value * (p.closing_sell_pct / 100);
|
||||
const buyer_nw = home_value - selling_costs - balance + buyer_portfolio;
|
||||
|
||||
// apply capital gains tax on portfolio gains when we "cash out" at end
|
||||
// (we track gross portfolio, deduct tax in summary)
|
||||
const renter_nw = portfolio;
|
||||
|
||||
// breakeven: when buyer net worth overtakes renter
|
||||
if (breakeven_month === null && buyer_nw >= renter_nw) {
|
||||
// breakeven uses after-tax renter value to match what the chart shows
|
||||
const renter_nw_after_tax = portfolio - Math.max(0, portfolio - start_capital) * (p.tax_rate / 100);
|
||||
if (breakeven_month === null && buyer_nw >= renter_nw_after_tax) {
|
||||
breakeven_month = m;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user