add hover tooltip to rent expenses column
This commit is contained in:
6
calc.js
6
calc.js
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user