Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default values assigned in tags #16

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions docs/Inflationcalculator/index.html
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Inflation calculator</title>
<link rel="stylesheet" href="../style.css" />
<script src="./script.js"></script>
</head>
<body onload="updateSliderValue('current_cost_slider', 'current_cost_value'); updateSliderValue('rate_of_inflation_slider', 'rate_of_inflation_value'); updateSliderValue('time_period_slider', 'time_period_value'); calculateResult();">
<body>

<h1>INFLATION CALCULATOR</h1>
<a href="../"><button>BACK</button></a>
<div class="container">
<label for="current_cost" >Current Cost</label>
<input type="number" class="Value_container" oninput="updateSliderValue('current_cost_value', 'current_cost_slider'); calculateResult()" id="current_cost_value" style= "margin-right: 5px; text-align: left;" />
<input type="number" class="Value_container" oninput="updateValueboxtoSlider('current_cost_value', 'current_cost_slider'); calculateResult()" id="current_cost_value" style= "margin-right: 5px; text-align: left;" />
<input type="text" class="Units" value="₹" disabled/><br/><br/>
<input type="range" min="1000" max="10000000" class="slider" id="current_cost_slider" oninput="updateSliderValue('current_cost_slider', 'current_cost_value'); calculateResult();" />
<input type="range" min="1000" max="10000000" class="slider" id="current_cost_slider" value="100000" oninput="updateSlidertoValuebox('current_cost_slider', 'current_cost_value'); calculateResult();" />
<br/><br/>

<label for="rate_of_inflation" >Rate of inflation(p.a)</label>
<input type="text" class="Units" value="%" style= "margin-right: 5px;" disabled/>
<input type="number" id="rate_of_inflation_value" oninput="updateSliderValue('rate_of_inflation_value', 'rate_of_inflation_slider'); calculateResult();" class="Value_container" /><br/><br/>
<input type="range" min="1.00" max="50.0" id="rate_of_inflation_slider" class="slider" step="0.1" oninput="updateSliderValue('rate_of_inflation_slider', 'rate_of_inflation_value'); calculateResult();" />
<input type="number" id="rate_of_inflation_value" oninput="updateValueboxtoSlider('rate_of_inflation_value', 'rate_of_inflation_slider'); calculateResult();" class="Value_container" /><br/><br/>
<input type="range" min="1.00" max="50.0" id="rate_of_inflation_slider" class="slider" step="0.1" value="6.0" oninput="updateSlidertoValuebox('rate_of_inflation_slider', 'rate_of_inflation_value'); calculateResult();" />
<br/><br/>

<label for="time_period">Time Period</label>
<input type="text" class="Units" value="Yr" style= "margin-right: 5px;" disabled />
<input type="number" id="time_period_value" oninput="updateSliderValue('time_period_value', 'time_period_slider'); calculateResult(); " class="Value_container" /><br/><br/>
<input type="range" min="1" max="30" id="time_period_slider" class="slider" oninput="updateSliderValue('time_period_slider', 'time_period_value'); calculateResult();" />
<input type="number" id="time_period_value" oninput="updateValueboxtoSlider('time_period_value', 'time_period_slider'); calculateResult(); " class="Value_container" /><br/><br/>
<input type="range" min="1" max="30" id="time_period_slider" class="slider" value = "5" oninput="updateSlidertoValuebox('time_period_slider', 'time_period_value'); calculateResult();" />
<br/><br/>

<div>
Expand Down
26 changes: 16 additions & 10 deletions docs/Inflationcalculator/script.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
var slider = document.getElementById('current_cost_slider');
slider.value = 100000;
var slider = document.getElementById('rate_of_inflation_slider');
slider.value = 6.0;
var slider = document.getElementById('time_period_slider');
slider.value = 5;
window.onload = function () {
updateSlidertoValuebox('current_cost_slider', 'current_cost_value');
updateSlidertoValuebox('rate_of_inflation_slider', 'rate_of_inflation_value');
updateSlidertoValuebox('time_period_slider', 'time_period_value');
calculateResult();
}

function updateSlidertoValuebox(slider, valuebox) {
var slider = document.getElementById(slider);
var valuebox = document.getElementById(valuebox);
valuebox.value = slider.value;
}

function updateSliderValue(slider, valuebox) {
var pa = document.getElementById(slider);
var val = document.getElementById(valuebox);
val.value = pa.value;
function updateValueboxToSlider(valuebox, slider) {
var valuebox = document.getElementById(valuebox);
var slider = document.getElementById(slider);
slider.value = valuebox.value;
}

function calculateResult() {
Expand Down
12 changes: 6 additions & 6 deletions docs/car_loan_emi/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ <h1>CAR LOAN EMI CALCULATOR</h1>
<a href="../"><button>BACK</button></a>
<div class="container">
<label for="loan_amount" >Loan amount</label>
<input type="number" class="Value_container" oninput="updateSliderValue('principal_amount_value', 'loan_amount_slider'); calculateResult()" id="principal_amount_value" style= "margin-right: 5px; text-align: left;" />
<input type="number" class="Value_container" oninput="updateValueboxtoSlider('principal_amount_value', 'loan_amount_slider'); calculateResult()" id="principal_amount_value" style= "margin-right: 5px; text-align: left;" />
<input type="text" class="Units" value="₹" disabled/><br/><br/>
<input type="range" min="100000" max="10000000" class="slider" id="loan_amount_slider" oninput="updateSliderValue('loan_amount_slider', 'principal_amount_value'); calculateResult();" />
<input type="range" min="100000" max="10000000" class="slider" id="loan_amount_slider" value = "1000000" oninput="updateSlidertoValuebox('loan_amount_slider', 'principal_amount_value'); calculateResult();" />
<br/><br/>

<label for="rate_of_interest" >Rate of interest(p.a)</label>
<input type="text" class="Units" value="%" style= "margin-right: 5px;" disabled/>
<input type="number" id="rate_of_interest_value" oninput="updateSliderValue('rate_of_interest_value', 'rate_of_interest_slider'); calculateResult();" class="Value_container" /><br/><br/>
<input type="range" min="1.00" max="30.0" id="rate_of_interest_slider" class="slider" step="0.1" oninput="updateSliderValue('rate_of_interest_slider', 'rate_of_interest_value'); calculateResult();" />
<input type="number" id="rate_of_interest_value" oninput="updateValueboxtoSlider('rate_of_interest_value', 'rate_of_interest_slider'); calculateResult();" class="Value_container" /><br/><br/>
<input type="range" min="1.00" max="30.0" id="rate_of_interest_slider" class="slider" step="0.1" value = "6.5" oninput="updateSlidertoValuebox('rate_of_interest_slider', 'rate_of_interest_value'); calculateResult();" />
<br/><br/>

<label for="loan_tenure">Loan tenure</label>
<input type="text" class="Units" value="Yr" style= "margin-right: 5px;" disabled />
<input type="number" id="loan_tenure_value" oninput="updateSliderValue('loan_tenure_value', 'loan_tenure_slider'); calculateResult(); " class="Value_container" /><br/><br/>
<input type="range" min="1" max="30" id="loan_tenure_slider" class="slider" oninput="updateSliderValue('loan_tenure_slider', 'loan_tenure_value'); calculateResult();" />
<input type="number" id="loan_tenure_value" oninput="updateValueboxtoSlider('loan_tenure_value', 'loan_tenure_slider'); calculateResult(); " class="Value_container" /><br/><br/>
<input type="range" min="1" max="30" id="loan_tenure_slider" class="slider" value = "5" oninput="updateSlidertoValuebox('loan_tenure_slider', 'loan_tenure_value'); calculateResult();" />
<br/><br/>

<div>
Expand Down
26 changes: 13 additions & 13 deletions docs/car_loan_emi/script.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
window.onload = function() {
var slider = document.getElementById('loan_amount_slider');
slider.value = 1000000;
var slider = document.getElementById('rate_of_interest_slider');
slider.value = 6.5;
var slider = document.getElementById('loan_tenure_slider');
slider.value = 5;
updateSliderValue('loan_amount_slider', 'principal_amount_value');
updateSliderValue('rate_of_interest_slider', 'rate_of_interest_value');
updateSliderValue('loan_tenure_slider', 'loan_tenure_value');
updateSlidertoValuebox('loan_amount_slider', 'principal_amount_value');
updateSlidertoValuebox('rate_of_interest_slider', 'rate_of_interest_value');
updateSlidertoValuebox('loan_tenure_slider', 'loan_tenure_value');
calculateResult();
}

function updateSliderValue(slider, valuebox) {
var pa = document.getElementById(slider);
var val = document.getElementById(valuebox);
val.value = pa.value;
function updateSlidertoValuebox(slider, valuebox) {
var slider = document.getElementById(slider);
var valuebox = document.getElementById(valuebox);
valuebox.value = slider.value;
}

function updateValueboxToSlider(valuebox, slider) {
var valuebox = document.getElementById(valuebox);
var slider = document.getElementById(slider);
slider.value = valuebox.value;
}

function calculateResult() {
Expand Down
11 changes: 7 additions & 4 deletions docs/cic/index.html
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Compound interest calculator</title>
<link rel="stylesheet" href="../style.css" />
<script src = "./script.js" ></script>
</head>
<body onload="updateSliderToValuebox('principal_amount_slider', 'principal_amount_value'); updateSliderToValuebox('rate_of_interest_slider', 'rate_of_interest_value'); updateSliderToValuebox('time_period_slider', 'time_period_value'); calculateResult();">
<body>

<h1>COMPOUND INTEREST CALCULATOR</h1>
<a href="../" ><button>Back</button></a>
<div class="container">
<label for="PA" >Principal Amount</label>
<input type="number" class="Value_container" oninput="updateValueboxToSlider('principal_amount_value', 'principal_amount_slider'); calculateResult()" id="principal_amount_value" style= "margin-right: 5px; text-align: left;" />
<input type="text" class="Units" value="₹" disabled/><br/><br/>
<input type="range" min="1000" max="10000000" class="slider" id="principal_amount_slider" oninput="updateSliderToValuebox('principal_amount_slider', 'principal_amount_value'); calculateResult();" />
<input type="range" min="1000" max="10000000" class="slider" id="principal_amount_slider" value = "100000" oninput="updateSliderToValuebox('principal_amount_slider', 'principal_amount_value'); calculateResult();" />
<br/><br/>

<label for="ri" >Rate of Interest</label>
<input type="text" class="Units" value="%" style= "margin-right: 5px;" disabled/>
<input type="number" id="rate_of_interest_value" oninput="updateValueboxToSlider('rate_of_interest_value', 'rate_of_interest_slider'); calculateResult();" class="Value_container" /><br/><br/>
<input type="range" min="1.00" max="50.0" id="rate_of_interest_slider" class="slider" step="0.1" oninput="updateSliderToValuebox('rate_of_interest_slider', 'rate_of_interest_value'); calculateResult();" />
<input type="range" min="1.00" max="50.0" id="rate_of_interest_slider" class="slider" step="0.1" value = "6.0" oninput="updateSliderToValuebox('rate_of_interest_slider', 'rate_of_interest_value'); calculateResult();" />
<br/><br/>

<label for="TP">Time Period</label>
<input type="text" class="Units" value="Yr" style= "margin-right: 5px;" disabled />
<input type="number" id="time_period_value" oninput="updateValueboxToSlider('time_period_value', 'time_period_slider'); calculateResult(); " class="Value_container" /><br/><br/>
<input type="range" min="1" max="30" id="time_period_slider" class="slider" oninput="updateSliderToValuebox('time_period_slider', 'time_period_value'); calculateResult();" />
<input type="range" min="1" max="30" id="time_period_slider" class="slider" value = "5" oninput="updateSliderToValuebox('time_period_slider', 'time_period_value'); calculateResult();" />
<br/><br/>

<label for="compound_frequency">Compound frequency</label>
Expand Down
34 changes: 17 additions & 17 deletions docs/cic/script.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
var slider = document.getElementById('principal_amount_slider');
slider.value = 100000;
var slider = document.getElementById('rate_of_interest_slider');
slider.value = 6.0;
var slider = document.getElementById('time_period_slider');
slider.value = 5;
windows.onload = function() {
updateSlidertoValuebox('princial_amount_slider', 'principal_amount_value');
updateSlidertoValuebox('rate_of_interest_slider', 'rate_of_interest_value');
updateSlidertoValuebox('time_period_slider', 'time_period_value');
calculateResult();
}

function getFrequency(){
function getFrequency() {
var frequency;
compound_frequency= document.getElementById('compound_frequency');
if(compound_frequency.value=='Half-Yearly') {
compound_frequency = document.getElementById('compound_frequency');
if (compound_frequency.value == 'Half-Yearly') {
frequency = 2;
}
else if(compound_frequency.value=='Quarterly') {
else if (compound_frequency.value == 'Quarterly') {
frequency = 4;
}
else if(compound_frequency.value == 'Monthly') {
else if (compound_frequency.value == 'Monthly') {
frequency = 12;
}
else {
Expand Down Expand Up @@ -44,13 +44,13 @@ function calculateResult() {
var total_interest_result = document.getElementById('total_interest_result');
var total_amount_result = document.getElementById('total_amount_result');

let principal_amount_result_formatted = Number(principal_amount).toLocaleString("en-IN", {style:"currency", currency:"INR", minimumFractionDigits: 0});
let principal_amount_result_formatted = Number(principal_amount).toLocaleString("en-IN", { style: "currency", currency: "INR", minimumFractionDigits: 0 });
principal_amount_result.value = principal_amount_result_formatted;
var total_amount_result_unformatted = principal_amount * ( (1 + (rate_of_interest / (100 * frequency) ) )**(frequency * time_period) );
var total_amount_result_formatted = Number(parseInt(total_amount_result_unformatted) + 1).toLocaleString("en-IN", {style:"currency", currency:"INR", minimumFractionDigits: 0});

var total_amount_result_unformatted = principal_amount * ((1 + (rate_of_interest / (100 * frequency))) ** (frequency * time_period));
var total_amount_result_formatted = Number(parseInt(total_amount_result_unformatted) + 1).toLocaleString("en-IN", { style: "currency", currency: "INR", minimumFractionDigits: 0 });
total_amount_result.value = total_amount_result_formatted;
var total_interest_result_formatted = Number(parseInt(total_amount_result_unformatted) + 1 - principal_amount).toLocaleString("en-IN", {style:"currency", currency:"INR", minimumFractionDigits: 0});

var total_interest_result_formatted = Number(parseInt(total_amount_result_unformatted) + 1 - principal_amount).toLocaleString("en-IN", { style: "currency", currency: "INR", minimumFractionDigits: 0 });
total_interest_result.value = total_interest_result_formatted;
}
11 changes: 7 additions & 4 deletions docs/emi/index.html
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>EMI calculator</title>
<link rel="stylesheet" href="../style.css" />
<script src="./script.js"></script>
</head>
<body onload="updateSliderToValuebox('loan_amount_slider', 'loan_amount_value'); updateSliderToValuebox('rate_of_interest_slider', 'rate_of_interest_value'); updateSliderToValuebox('tenure_slider', 'tenure_value'); calculateResult();">
<body>

<h1>EMI CALCULATOR</h1>
<a href="../" ><button>Back</button></a>
<div class="container">
<label for="Loan amount" >Loan Amount</label>
<input type="number" class="Value_container" oninput="updateValueboxToSlider('loan_amount_value', 'loan_amount_slider'); calculateResult()" id="loan_amount_value" style= "margin-right: 5px; text-align: left;" />
<input type="text" class="Units" value="₹" disabled/><br/><br/>
<input type="range" min="100000" max="10000000" class="slider" id="loan_amount_slider" oninput="updateSliderToValuebox('loan_amount_slider', 'loan_amount_value'); calculateResult();" />
<input type="range" min="100000" max="10000000" class="slider" id="loan_amount_slider" value="1000000" oninput="updateSliderToValuebox('loan_amount_slider', 'loan_amount_value'); calculateResult();" />
<br/><br/>

<label for="Rate of Interest" >Rate of Interest(p.a.)</label>
<input type="text" class="Units" value="%" style= "margin-right: 5px;" disabled/>
<input type="number" id="rate_of_interest_value" oninput="updateValueboxToSlider('rate_of_interest_value', 'rate_of_interest_slider'); calculateResult();" class="Value_container" /><br/><br/>
<input type="range" min="1.00" max="30.0" id="rate_of_interest_slider" class="slider" step="0.1" oninput="updateSliderToValuebox('rate_of_interest_slider', 'rate_of_interest_value'); calculateResult();" />
<input type="range" min="1.00" max="30.0" id="rate_of_interest_slider" class="slider" step="0.1" value="6.5" oninput="updateSliderToValuebox('rate_of_interest_slider', 'rate_of_interest_value'); calculateResult();" />
<br/><br/>

<label for="Tenure">Tenure</label>
<input type="text" class="Units" value="Yr" style= "margin-right: 5px;" disabled />
<input type="number" id="tenure_value" oninput="updateValueboxToSlider('tenure_value', 'tenure_slider'); calculateResult(); " class="Value_container" /><br/><br/>
<input type="range" min="1" max="30" id="tenure_slider" class="slider" oninput="updateSliderToValuebox('tenure_slider', 'tenure_value'); calculateResult();" />
<input type="range" min="1" max="30" id="tenure_slider" class="slider" value = "5" oninput="updateSliderToValuebox('tenure_slider', 'tenure_value'); calculateResult();" />
<br/><br/><br/><br/>

<div>
Expand Down
Loading