Skip to content

Commit 1e246b9

Browse files
committed
fixed a bug on loan calculator and a typo on drum(darkmode)
1 parent df2cb23 commit 1e246b9

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

DRUM(darkmode)/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
</nav>
2626
<div class="header">
2727
<h1>DRUM KIT</h1>
28-
<p class="band-tagline">Drummig is my therapy!</p>
28+
<p class="band-tagline">Drumming is my therapy!</p>
2929
</div>
3030

3131
<div class="kit"></div>

Loan Calculator/index.html

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ <h3>Loan Calculator</h3>
1919
<p>Months to Pay:
2020
<input type="number" value="1" id="months" min="0" onchange="calculateLoan()"> </p>
2121
<h2 id="payment"></h2> </div>
22-
<script src="script.js">
23-
function calculateLoan() {
24-
const amount = document.querySelector("#amount").value;
25-
const interestRate = document.querySelector("#interest").value;
26-
const months = document.querySelector("#months").value;
27-
const monthlyRate = (interestRate) / (12 * 100);
28-
const onePlusR = Math.pow(1 + monthlyRate, months);
29-
const den = onePlusR - 1;
30-
const emi = (amount * monthlyRate * (onePlusR / den)).toFixed(2);
31-
const totalPay = (emi * months).toFixed(2);
32-
document.querySelector("#payment").innerHTML = `EMI: ₹ ${emi} <br><br> Total Payment: ₹${totalPay}`
33-
}
22+
<script>
23+
function calculateLoan() {
24+
const amount = document.querySelector("#amount").value;
25+
const interestRate = document.querySelector("#interest").value;
26+
const months = document.querySelector("#months").value;
27+
const monthlyRate = (interestRate) / (12 * 100);
28+
const onePlusR = Math.pow(1 + monthlyRate, months);
29+
const den = onePlusR - 1;
30+
const emi = (amount * monthlyRate * (onePlusR / den)).toFixed(2);
31+
const totalPay = (emi * months).toFixed(2);
32+
document.querySelector("#payment").innerHTML = `EMI: ₹ ${emi} <br><br> Total Payment: ₹${totalPay}`
33+
}
3434
</script>
3535
</body>
3636

37-
</html>
37+
</html>

0 commit comments

Comments
 (0)