Enter the following information to calculate your net worth.
function calculateWealth() {
// Get the values from the input fields
const income = document.getElementById("income").value; const expenses = document.getElementById("expenses").value; const assets = document.getElementById("assets").value; const liabilities = document.getElementById("liabilities").value;
// Calculate the net worth
const netWorth = assets - liabilities;
// Display the net worth in the output section
document.getElementById("wealth-output").innerHTML = netWorth;
}
Enter the following information to calculate your expected net worth.
function calculateWealth() {
// Get the values from the input fields
const currentAge = document.getElementById("current-age").value; const netIncome = document.getElementById("net-income").value; const netWorth = document.getElementById("net-worth").value;
// Calculate the expected net worth
const expectedNetWorth = calculateExpectedNetWorth(currentAge, netIncome, netWorth);
// Display the expected net worth in the output section
document.getElementById("wealth-output").innerHTML = expectedNetWorth;
// Determine whether the user is an under accumulator or over accumulator of wealth
const isUnderAccumulator = expectedNetWorth < 20 * netIncome; const isOverAccumulator = expectedNetWorth > 30 * netIncome;
// Display a message to the user indicating whether they are an under accumulator or over accumulator of wealth
if (isUnderAccumulator) { document.getElementById("wealth-message").innerHTML = "You are an under accumulator of wealth."; } else if (isOverAccumulator) { document.getElementById("wealth-message").innerHTML = "You are an over accumulator of wealth."; } else { document.getElementById("wealth-message").innerHTML = "You are a normal accumulator of wealth."; }
}
function calculateExpectedNetWorth(currentAge, netIncome, netWorth) {
// Calculate the number of years until retirement
const retirementAge = 65; const yearsUntilRetirement = retirementAge - currentAge;
// Calculate the annual savings rate
const annualSavingsRate = (netIncome - netWorth) / yearsUntilRetirement;
// Calculate the expected net worth
const expectedNetWorth = netWorth + (annualSavingsRate * netIncome) * yearsUntilRetirement;
return expectedNetWorth;
}
To use the FIRE calculator you’ll need to provide the following information: