show Restschuld as negative in buy net worth tooltip

This commit is contained in:
Johannes
2026-03-20 02:26:53 +01:00
parent ba906bf35e
commit 9d735fb10f
2 changed files with 2 additions and 0 deletions

View File

@@ -116,6 +116,7 @@ function run_simulation(p) {
cum_rent_arr.push(Math.round(cum_rent_cost)); cum_rent_arr.push(Math.round(cum_rent_cost));
detail_arr.push({ detail_arr.push({
house_value: Math.round(home_value), house_value: Math.round(home_value),
mortgage_balance: Math.round(balance),
buyer_portfolio: Math.round(buyer_portfolio), buyer_portfolio: Math.round(buyer_portfolio),
yr_interest: Math.round(yr_interest), yr_interest: Math.round(yr_interest),
yr_principal: Math.round(yr_principal), yr_principal: Math.round(yr_principal),

1
ui.js
View File

@@ -193,6 +193,7 @@ const build_table = (result) => {
td_buy_nw.addEventListener('mouseenter', (e) => show_tooltip(e, [ td_buy_nw.addEventListener('mouseenter', (e) => show_tooltip(e, [
tip_row('Immobilienwert', d.house_value, '#f59e0b'), tip_row('Immobilienwert', d.house_value, '#f59e0b'),
tip_row('ETF-Portfolio', d.buyer_portfolio, '#f59e0b'), tip_row('ETF-Portfolio', d.buyer_portfolio, '#f59e0b'),
tip_row('Restschuld', -d.mortgage_balance, '#ef4444'),
].join('<br>'))); ].join('<br>')));
const td_rent_nw = document.createElement('td'); const td_rent_nw = document.createElement('td');