Current Second Home Affordability Calculator

Current Second Home Affordability Calculator

Second Home Affordability Calculator

Estimate the affordability of your second home based on your financial details.

Not calculated yet.

let affordabilitySteps = “”; function calculateAffordability() { affordabilitySteps=””; const income = parseFloat(document.getElementById(“income”).value); const existingDebt = parseFloat(document.getElementById(“existingDebt”).value); const monthlyPayment = parseFloat(document.getElementById(“monthlyPayment”).value); const secondHomePrice = parseFloat(document.getElementById(“secondHomePrice”).value); const downPayment = parseFloat(document.getElementById(“downPayment”).value); const interestRate = parseFloat(document.getElementById(“interestRate”).value) / 100; const loanTerm = parseFloat(document.getElementById(“loanTerm”).value); if (isNaN(income) || isNaN(existingDebt) || isNaN(monthlyPayment) || isNaN(secondHomePrice) || isNaN(downPayment) || isNaN(interestRate) || isNaN(loanTerm)) { alert(“Please enter valid positive values for all fields.”); return; } const loanAmount = secondHomePrice – downPayment; const monthlyInterestRate = interestRate / 12; const numberOfPayments = loanTerm * 12; const monthlyLoanPayment = loanAmount * monthlyInterestRate / (1 – Math.pow(1 + monthlyInterestRate, -numberOfPayments)); const affordability = (income * 0.28) – (existingDebt + monthlyPayment + monthlyLoanPayment); document.getElementById(“affordabilityResult”).value = affordability.toFixed(2); affordabilitySteps += `Inputs:
Annual Income: $${income}
Existing Debt: $${existingDebt}
Current Monthly Mortgage Payment: $${monthlyPayment}
Price of Second Home: $${secondHomePrice}
Down Payment: $${downPayment}
Interest Rate: ${interestRate * 100}%
Loan Term: ${loanTerm} years

`; affordabilitySteps += `Formulas:
Monthly Loan Payment = Loan Amount × Monthly Interest Rate / (1 – (1 + Monthly Interest Rate) ^ -Number of Payments)
Affordability = Income × 28% – (Existing Debt + Current Mortgage + Monthly Loan Payment)

`; affordabilitySteps += `Results:
Estimated Affordability: $${affordability.toFixed(2)}
`; if (document.getElementById(“calculationStepsAffordability”).style.display === “block”) { document.getElementById(“calculationStepsAffordability”).innerHTML = affordabilitySteps; } } function resetAffordability() { document.querySelectorAll(“#calculator input”).forEach(el => el.value = “”); affordabilitySteps = “”; document.getElementById(“calculationStepsAffordability”).innerHTML = “

Not calculated yet.

“; } function toggleAffordabilitySteps() { const s = document.getElementById(“calculationStepsAffordability”); const a = document.getElementById(“toggleArrowAffordability”); if (s.style.display === “none” || s.style.display === “”) { s.style.display = “block”; a.style.transform = “rotate(180deg)”; s.innerHTML = affordabilitySteps || “

Not calculated yet.

“; } else { s.style.display = “none”; a.style.transform = “rotate(0deg)”; } }

Leave a Reply

Your email address will not be published. Required fields are marked *