Car Loan Calculator Fees

Car Loan Calculator Fees

Loan Details:

Monthly Payment: $0.00

Total Payment: $0.00

Total Interest: $0.00

Total Fees: $0.00

document.getElementById(‘carLoanCalculatorForm’).addEventListener(‘submit’, function(e) { e.preventDefault(); var loanAmount = parseFloat(document.getElementById(‘loanAmount’).value); var interestRate = parseFloat(document.getElementById(‘interestRate’).value) / 100; var loanTerm = parseFloat(document.getElementById(‘loanTerm’).value); var fees = parseFloat(document.getElementById(‘fees’).value); var monthlyInterestRate = interestRate / 12; var numberOfPayments = loanTerm * 12; var monthlyPayment = (loanAmount * monthlyInterestRate) / (1 – Math.pow(1 + monthlyInterestRate, -numberOfPayments)); var totalPayment = monthlyPayment * numberOfPayments; var totalInterest = totalPayment – loanAmount; document.getElementById(‘monthlyPayment’).innerText = “Monthly Payment: $” + monthlyPayment.toFixed(2); document.getElementById(‘totalPayment’).innerText = “Total Payment: $” + totalPayment.toFixed(2); document.getElementById(‘totalInterest’).innerText = “Total Interest: $” + totalInterest.toFixed(2); document.getElementById(‘totalFees’).innerText = “Total Fees: $” + fees.toFixed(2); });

Leave a Reply

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