Wealth Expectation Calculator

#TODO out of date with latest assumptions in The Plan

var formatter = new Intl.NumberFormat('en-US', {
  style: 'currency',
  currency: 'BRL',
});
let round = (x) => (Math.round(100*x)/100).toFixed(2)
let income = (t) => (
	10_000
	* Math.pow(1.06, Math.floor(t/12))
);
let returns = (t) => (
	3_000
	* (Math.pow(1.0005, t) - 1)
	* Math.pow(1.06, Math.floor(t/12))
);
let wealth = (t) => (
	6_000_000
	* (Math.pow(1.0005, t) - 1)
	* Math.pow(1.06, Math.floor(t/12))
);

let indexes = [...Array(258).keys()];
dv.table(
	["Date", "Wealth", "Ratio"],
	indexes.map(i => [
		`${2019+Math.floor((5+i)/12)}-${(5+i)%12+1}`,
		formatter.format(wealth(i+1)),
		`${round((12*7_000)/(wealth(i+1)*0.6)*100)}%`,
	])
);