Home Loan Emi Calculator Pdf

Home Loan EMI Calculator

function calculateEMI() { const loanAmount = parseFloat(document.getElementById(‘loanAmount’).value); const tenure = parseFloat(document.getElementById(‘loanTenure’).value); const interestRate = parseFloat(document.getElementById(‘interestRate’).value); if (isNaN(loanAmount) || isNaN(tenure) || isNaN(interestRate) || loanAmount <= 0 || tenure <= 0 || interestRate <= 0) { alert("Please enter valid values for all fields."); return; } const monthlyRate = interestRate / 12 / 100; const numberOfMonths = tenure * 12; const emi = (loanAmount * monthlyRate * Math.pow(1 + monthlyRate, numberOfMonths)) / (Math.pow(1 + monthlyRate, numberOfMonths) – 1); document.getElementById('emiResult').value = emi.toFixed(2); } function resetForm() { document.getElementById('homeLoanEMIForm').reset(); document.getElementById('emiResult').value = ""; document.getElementById('calculationSteps').style.display = "none"; } function toggleSteps() { const steps = document.getElementById('calculationSteps'); steps.style.display = steps.style.display === "none" ? "block" : "none"; }

Leave a Reply

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