Nab Personal Loan Calculator

NAB Personal Loan Calculator

Estimate your personal loan repayments and interest with this simple NAB personal loan calculator.

Monthly Fortnightly Weekly
function calculateLoanRepayment() { const loanAmount = parseFloat(document.getElementById(‘loanAmount’).value); const interestRate = parseFloat(document.getElementById(‘interestRate’).value) / 100; const loanTerm = parseInt(document.getElementById(‘loanTerm’).value); const repaymentFrequency = document.getElementById(‘repaymentFrequency’).value; if (isNaN(loanAmount) || isNaN(interestRate) || isNaN(loanTerm)) { alert(“Please fill out all fields with valid numbers.”); return; } let repaymentPerYear; if (repaymentFrequency === ‘monthly’) repaymentPerYear = 12; if (repaymentFrequency === ‘fortnightly’) repaymentPerYear = 26; if (repaymentFrequency === ‘weekly’) repaymentPerYear = 52; const monthlyInterestRate = interestRate / 12; const numberOfPayments = loanTerm * repaymentPerYear; const monthlyRepayment = loanAmount * monthlyInterestRate / (1 – Math.pow(1 + monthlyInterestRate, -numberOfPayments)); const totalRepayment = monthlyRepayment * numberOfPayments; const totalInterest = totalRepayment – loanAmount; document.getElementById(‘monthlyRepayment’).value = monthlyRepayment.toFixed(2); document.getElementById(‘totalInterest’).value = totalInterest.toFixed(2); document.getElementById(‘totalRepayment’).value = totalRepayment.toFixed(2); }

Leave a Reply

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