add hover tooltip to rent expenses column

This commit is contained in:
Johannes
2026-03-20 02:21:49 +01:00
parent 1b7029681e
commit 8e452f484c
2 changed files with 12 additions and 0 deletions

View File

@@ -49,6 +49,7 @@ function run_simulation(p) {
// yearly accumulators (reset each year)
let yr_interest = 0, yr_principal = 0, yr_upkeep = 0;
let yr_rent = 0, yr_renters_ins = 0;
let breakeven_month = null;
@@ -81,6 +82,8 @@ function run_simulation(p) {
// --- rent side ---
const renters_ins_m = p.renters_ins / 12;
const total_rent_m = monthly_rent + renters_ins_m;
yr_rent += monthly_rent;
yr_renters_ins += renters_ins_m;
cum_rent_cost += total_rent_m;
// renter invests the difference if buying is more expensive
@@ -116,8 +119,11 @@ function run_simulation(p) {
yr_interest: Math.round(yr_interest),
yr_principal: Math.round(yr_principal),
yr_upkeep: Math.round(yr_upkeep),
yr_rent: Math.round(yr_rent),
yr_renters_ins: Math.round(yr_renters_ins),
});
yr_interest = 0; yr_principal = 0; yr_upkeep = 0;
yr_rent = 0; yr_renters_ins = 0;
}
}