From 7d85306b3f70c098a7d1992167e48e220b1b853f Mon Sep 17 00:00:00 2001 From: AsmitaMishra24 <146121869+AsmitaMishra24@users.noreply.github.com> Date: Fri, 9 Aug 2024 17:34:59 +0530 Subject: [PATCH] Added RD Calculator --- tools/RDCalculator.js | 33 +++++++++++++++++++++++ tools/sip.html | 61 ++++++++++++++++++++++++++++++++++++++----- 2 files changed, 87 insertions(+), 7 deletions(-) create mode 100644 tools/RDCalculator.js diff --git a/tools/RDCalculator.js b/tools/RDCalculator.js new file mode 100644 index 0000000..24b5abc --- /dev/null +++ b/tools/RDCalculator.js @@ -0,0 +1,33 @@ +document.addEventListener("DOMContentLoaded", function() { + document.getElementById("calculate-Btn3").addEventListener("click", function() { + const monthlyInstallment = parseFloat(document.getElementById("monthly-installment").value); + const annualInterestRate = parseFloat(document.getElementById("rate1").value); + const timePeriodMonths = parseFloat(document.getElementById("months1").value); + + if (isNaN(monthlyInstallment) || isNaN(annualInterestRate) || isNaN(timePeriodMonths)) { + alert("Please fill in all fields"); + return; + } + + const monthlyInterestRate = annualInterestRate / 12 / 100; + + let maturityAmount = 0; + for (let i = 0; i < timePeriodMonths; i++) { + maturityAmount += monthlyInstallment * Math.pow((1 + monthlyInterestRate), (timePeriodMonths - i)); + } + + const totalInvestAmount = monthlyInstallment * timePeriodMonths; + const interestEarned = maturityAmount - totalInvestAmount; + + document.getElementById("interestEarned1").innerText = `₹${interestEarned.toFixed(2)}`; + document.getElementById("maturityAmount1").innerText = `₹${maturityAmount.toFixed(2)}`; + }); + + document.getElementById("clearBtn2").addEventListener("click", function() { + document.getElementById("monthly-installment").value = ''; + document.getElementById("rate1").value = ''; + document.getElementById("months1").value = ''; + document.getElementById("interestEarned1").innerText = ''; + document.getElementById("maturityAmount1").innerText = ''; + }); +}); diff --git a/tools/sip.html b/tools/sip.html index c31c82c..d2d9644 100644 --- a/tools/sip.html +++ b/tools/sip.html @@ -878,10 +878,6 @@
Result:
- - - - @@ -926,8 +922,6 @@
Result:
- - @@ -1107,7 +1101,6 @@
Result:
- @@ -1201,6 +1194,60 @@
Result:
+ + + +
+

Recurring Deposit Calculator

+

The RD (Recurring Deposit) calculator computes the maturity amount and interest earned on regular monthly deposits over a fixed period, given a specified annual interest rate.

+
+ +
+
Here's how it works:
+
    +
  1. Monthly Installment (₹): Enter your monthly installment amount.
  2. +
  3. Annual Interest Rate (%): Enter your annual interest rate.
  4. +
  5. Total Period (in months): Enter your total period of investment in months.
  6. +
  7. Total Interest Earned: Analyzes and provides the total interest earned on your investment.
  8. +
  9. Total Maturity Amount: Analyzes and provides total maturity amount.
  10. +
+
+
+
+ +
+
+
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+
Result:
+

Total Interest Earned:

+

Total Maturity Amount:

+
+
+
+
+ +