Advertisement
Kali_prasad

java script emi calc correct

Mar 9th, 2022
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const _principalAmount = document.getElementById("principalAmount");
  2. const _interestRateYear = document.getElementById("interestRate");
  3. const _tenureMonth = document.getElementById("tenure");
  4. const _result = document.getElementById("result");
  5.  
  6. function calculateEMI() {
  7.     const principalAmount = Number(_principalAmount.value);
  8.     const interestRateYear = Number(_interestRateYear.value);
  9.     const interestRateMonth = Number(interestRateYear / 1200);
  10.     const tenureMonth = Number(_tenureMonth.value);
  11.  
  12.     const emi = getEmiReducing(principalAmount, tenureMonth, interestRateMonth);
  13.     _result.innerText = "EMI is Rs." + emi.toFixed(2);
  14.  
  15.     return false;
  16. }
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement