Amortization Calculator India Excel

Amortization Calculator India Excel

Not calculated yet.

let steps = “”; const currencySymbol = “₹”, fixedCurrency = “INR”; function calculateEMI(){ steps=””; const loanAmount = parseFloat(document.getElementById(“loanAmount”).value); const interestRate = parseFloat(document.getElementById(“interestRate”).value); const loanTerm = parseFloat(document.getElementById(“loanTerm”).value); if(isNaN(loanAmount) || isNaN(interestRate) || isNaN(loanTerm) || loanAmount <= 0 || interestRate <= 0 || loanTerm <= 0){ alert("Please enter valid positive values for all fields."); return; } const monthlyInterestRate = interestRate / 12 / 100; const numberOfPayments = loanTerm * 12; const emi = loanAmount * monthlyInterestRate * Math.pow(1 + monthlyInterestRate, numberOfPayments) / (Math.pow(1 + monthlyInterestRate, numberOfPayments) – 1); document.getElementById("emiResult").value = formatCurrency(emi); steps += `Inputs:
Loan Amount: ${formatCurrency(loanAmount)}
Interest Rate: ${interestRate}%
Loan Term: ${loanTerm} years

`; steps += `Formula:
EMI = P × r × (1 + r)^n / ((1 + r)^n – 1)

`; steps += `Result:
EMI: ${formatCurrency(emi)}
`; if(document.getElementById(“calculationSteps”).style.display === “block”){ document.getElementById(“calculationSteps”).innerHTML = steps; } } function resetCalculator(){ document.querySelectorAll(“#calculator input”).forEach(el => el.value = “”); steps = “”; document.getElementById(“calculationSteps”).innerHTML = “

Not calculated yet.

“; } function toggleCalculationSteps(){ const s = document.getElementById(“calculationSteps”); const a = document.getElementById(“toggleArrow”); if(s.style.display === “none” || s.style.display === “”){ s.style.display = “block”; a.style.transform = “rotate(180deg)”; s.innerHTML = steps || “

Not calculated yet.

“; } else { s.style.display = “none”; a.style.transform = “rotate(0deg)”; } } function formatCurrency(n){ return currencySymbol + n.toFixed(2) + ” ” + fixedCurrency; }

Leave a Reply

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