EMI CALCULATOR CODE
<html>
<head>
<title>EMI Calculator</title>
<style>
.container {
max-width: 400px;
margin: 0 auto;
padding: 20px;
border: 1px solid #ccc;
border-radius: 4px;
}
.form-group {
margin-bottom: 10px;
}
.form-group label {
display: block;
font-weight: bold;
}
.form-group input {
width: 100%;
padding: 5px;
border: 1px solid #ccc;
border-radius: 4px;
}
.result {
margin-top: 20px;
font-weight: bold;
}
</style>
</head>
<body>
<div class="container">
<h2>EMI Calculator</h2>
<div class="form-group">
<label>Loan Amount:</label>
<input id="loanAmount" placeholder="Loan amount" type="number" />
</div>
<div class="form-group">
<label>Interest Rate:</label>
<input id="interestRate" placeholder="Interest rate" type="number" />
</div>
<div class="form-group">
<label>Tenure (in months):</label>
<input id="tenure" placeholder="Loan tenure in months" type="number" />
</div>
<button onclick="calculateEMI()">Calculate EMI</button>
<div class="result" id="emiResult"></div>
</div>
<script>
function calculateEMI() {
var loanAmount = parseFloat(document.getElementById('loanAmount').value);
var interestRate = parseFloat(document.getElementById('interestRate').value);
var tenure = parseInt(document.getElementById('tenure').value);
if (isNaN(loanAmount) || isNaN(interestRate) || isNaN(tenure)) {
document.getElementById('emiResult').innerHTML = 'Please enter valid inputs.';
return;
}
var monthlyInterest = interestRate / 100 / 12;
var emi = (loanAmount * monthlyInterest * Math.pow(1 + monthlyInterest, tenure)) /
(Math.pow(1 + monthlyInterest, tenure) - 1);
emi = emi.toFixed(2);
document.getElementById('emiResult').innerHTML = 'EMI: $' + emi;
}
</script>
</body>
</html>
FD RETURNS CALCULATOR WITH COMPOUND INTREST RATE
<html>
<head>
<title>FD Return Calculator (Compound Interest)</title>
<style>
body {
font-family: Arial, sans-serif;
}
.container {
max-width: 400px;
margin: 0 auto;
padding: 20px;
border: 1px solid #ccc;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
h1 {
text-align: center;
}
.form-group {
margin-bottom: 20px;
}
.form-group label {
display: block;
font-weight: bold;
}
.form-group input[type="text"] {
width: 100%;
padding: 8px;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
.form-group input[type="submit"] {
width: 100%;
padding: 10px;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
}
#result {
text-align: center;
margin-top: 20px;
font-weight: bold;
}
</style>
</head>
<body>
<div class="container">
<h1>FD Return Calculator (Compound Interest)</h1>
<form id="calculatorForm">
<div class="form-group">
<label for="principalAmount">Principal Amount:</label>
<input id="principalAmount" placeholder="Enter principal amount" required="" type="text" />
</div>
<div class="form-group">
<label for="interestRate">Annual Interest Rate (%):</label>
<input id="interestRate" placeholder="Enter annual interest rate" required="" type="text" />
</div>
<div class="form-group">
<label for="investmentDuration">Investment Duration (Years):</label>
<input id="investmentDuration" placeholder="Enter investment duration in years" required="" type="text" />
</div>
<div class="form-group">
<input id="calculateBtn" type="submit" value="Calculate" />
</div>
</form>
<div id="result"></div>
</div>
<script>
document.getElementById('calculatorForm').addEventListener('submit', function (event) {
event.preventDefault();
calculateReturns();
});
function calculateReturns() {
var principalAmount = parseFloat(document.getElementById('principalAmount').value);
var interestRate = parseFloat(document.getElementById('interestRate').value);
var investmentDuration = parseFloat(document.getElementById('investmentDuration').value);
var compoundInterest = principalAmount * Math.pow((1 + (interestRate / 100)), investmentDuration);
var interestEarned = compoundInterest - principalAmount;
var resultElement = document.getElementById('result');
resultElement.innerHTML = "Compound Interest: $" + interestEarned.toFixed(2) + "<br>Total Amount: $" + compoundInterest.toFixed(2);
}
</script>
</body>
</html>
FD RETURNS CALCULATOR WITH SIMPLE INTEREST RATE
<html>
<head>
<title>FD Return Calculator</title>
<style>
body {
font-family: Arial, sans-serif;
}
.container {
max-width: 400px;
margin: 0 auto;
padding: 20px;
border: 1px solid #ccc;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
h1 {
text-align: center;
}
.form-group {
margin-bottom: 20px;
}
.form-group label {
display: block;
font-weight: bold;
}
.form-group input[type="text"] {
width: 100%;
padding: 8px;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
.form-group input[type="submit"] {
width: 100%;
padding: 10px;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
}
#result {
text-align: center;
margin-top: 20px;
font-weight: bold;
}
</style>
</head>
<body>
<div class="container">
<h1>FD Return Calculator</h1>
<form id="calculatorForm">
<div class="form-group">
<label for="principalAmount">Principal Amount:</label>
<input id="principalAmount" placeholder="Enter principal amount" required="" type="text" />
</div>
<div class="form-group">
<label for="interestRate">Annual Interest Rate (%):</label>
<input id="interestRate" placeholder="Enter annual interest rate" required="" type="text" />
</div>
<div class="form-group">
<label for="investmentDuration">Investment Duration (Months):</label>
<input id="investmentDuration" placeholder="Enter investment duration in months" required="" type="text" />
</div>
<div class="form-group">
<input id="calculateBtn" type="submit" value="Calculate" />
</div>
</form>
<div id="result"></div>
</div>
<script>
document.getElementById('calculatorForm').addEventListener('submit', function (event) {
event.preventDefault();
calculateReturns();
});
function calculateReturns() {
var principalAmount = parseFloat(document.getElementById('principalAmount').value);
var interestRate = parseFloat(document.getElementById('interestRate').value);
var investmentDuration = parseFloat(document.getElementById('investmentDuration').value);
var interestEarned = (principalAmount * interestRate * investmentDuration) / (12 * 100);
var maturityAmount = principalAmount + interestEarned;
var resultElement = document.getElementById('result');
resultElement.innerHTML = "Interest Earned: $" + interestEarned.toFixed(2) + "<br>Maturity Amount: $" + maturityAmount.toFixed(2);
}
</script>
</body>
</html>
INTEREST RATE CALCULATOR
<html>
<head>
<title>Interest Rate Calculator</title>
<style>
body {
font-family: Arial, sans-serif;
}
.container {
max-width: 400px;
margin: 0 auto;
padding: 20px;
border: 1px solid #ccc;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
h1 {
text-align: center;
}
.form-group {
margin-bottom: 20px;
}
.form-group label {
display: block;
font-weight: bold;
}
.form-group input[type="text"] {
width: 100%;
padding: 8px;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
.form-group input[type="submit"] {
width: 100%;
padding: 10px;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
}
#result {
text-align: center;
margin-top: 20px;
font-weight: bold;
}
</style>
</head>
<body>
<div class="container">
<h1>Interest Rate Calculator</h1>
<form id="calculatorForm">
<div class="form-group">
<label for="loanAmount">Loan Amount:</label>
<input id="loanAmount" placeholder="Enter loan amount" required="" type="text" />
</div>
<div class="form-group">
<label for="emiAmount">EMI Amount:</label>
<input id="emiAmount" placeholder="Enter EMI amount" required="" type="text" />
</div>
<div class="form-group">
<label for="loanTenure">Loan Tenure (in months):</label>
<input id="loanTenure" placeholder="Enter loan tenure in months" required="" type="text" />
</div>
<div class="form-group">
<input id="calculateBtn" type="submit" value="Calculate" />
</div>
</form>
<div id="result"></div>
</div>
<script>
document.getElementById('calculatorForm').addEventListener('submit', function (event) {
event.preventDefault();
calculateInterestRate();
});
function calculateInterestRate() {
var loanAmount = parseFloat(document.getElementById('loanAmount').value);
var emiAmount = parseFloat(document.getElementById('emiAmount').value);
var loanTenure = parseFloat(document.getElementById('loanTenure').value);
var interestRate = ((emiAmount * loanTenure * 12) / loanAmount) * 100;
var resultElement = document.getElementById('result');
resultElement.innerHTML = "Interest Rate: " + interestRate.toFixed(2) + "%";
}
</script>
</body>
</html>
SIP RETURNS CALCULATOR
<html>
<head>
<title>SIP Return Calculator</title>
<style>
body {
font-family: Arial, sans-serif;
}
.container {
max-width: 400px;
margin: 0 auto;
padding: 20px;
border: 1px solid #ccc;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
h1 {
text-align: center;
}
.form-group {
margin-bottom: 20px;
}
.form-group label {
display: block;
font-weight: bold;
}
.form-group input[type="text"] {
width: 100%;
padding: 8px;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
.form-group input[type="submit"] {
width: 100%;
padding: 10px;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
}
#result {
text-align: center;
margin-top: 20px;
font-weight: bold;
}
</style>
</head>
<body>
<div class="container">
<h1>SIP Return Calculator</h1>
<form id="calculatorForm">
<div class="form-group">
<label for="monthlyInvestment">Monthly Investment Amount:</label>
<input id="monthlyInvestment" placeholder="Enter monthly investment amount" required="" type="text" />
</div>
<div class="form-group">
<label for="annualReturn">Annual Return Rate (%):</label>
<input id="annualReturn" placeholder="Enter annual return rate" required="" type="text" />
</div>
<div class="form-group">
<label for="investmentDuration">Investment Duration (Months):</label>
<input id="investmentDuration" placeholder="Enter investment duration in months" required="" type="text" />
</div>
<div class="form-group">
<input id="calculateBtn" type="submit" value="Calculate" />
</div>
</form>
<div id="result"></div>
</div>
<script>
document.getElementById('calculatorForm').addEventListener('submit', function (event) {
event.preventDefault();
calculateReturns();
});
function calculateReturns() {
var monthlyInvestment = parseFloat(document.getElementById('monthlyInvestment').value);
var annualReturn = parseFloat(document.getElementById('annualReturn').value);
var investmentDuration = parseFloat(document.getElementById('investmentDuration').value);
var totalInvestment = monthlyInvestment * investmentDuration;
var futureValue = 0;
for (var i = 1; i <= investmentDuration; i++) {
futureValue += monthlyInvestment;
futureValue *= (1 + (annualReturn / 100) / 12);
}
var resultElement = document.getElementById('result');
resultElement.innerHTML = "Total Investment: $" + totalInvestment.toFixed(2) + "<br>Future Value: $" + futureValue.toFixed(2);
}
</script>
</body>
</html>
MUTUAL FUND RETURNS CALCULATOR
<html>
<head>
<title>Mutual Fund Return Calculator</title>
<style>
body {
font-family: Arial, sans-serif;
}
.container {
max-width: 400px;
margin: 0 auto;
padding: 20px;
border: 1px solid #ccc;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
h1 {
text-align: center;
}
.form-group {
margin-bottom: 20px;
}
.form-group label {
display: block;
font-weight: bold;
}
.form-group input[type="text"] {
width: 100%;
padding: 8px;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
.form-group input[type="submit"] {
width: 100%;
padding: 10px;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
}
#result {
text-align: center;
margin-top: 20px;
font-weight: bold;
}
</style>
</head>
<body>
<div class="container">
<h1>Mutual Fund Return Calculator</h1>
<form id="calculatorForm">
<div class="form-group">
<label for="initialInvestment">Initial Investment Amount:</label>
<input id="initialInvestment" placeholder="Enter initial investment amount" required="" type="text" />
</div>
<div class="form-group">
<label for="annualReturn">Annual Return Rate (%):</label>
<input id="annualReturn" placeholder="Enter annual return rate" required="" type="text" />
</div>
<div class="form-group">
<label for="investmentDuration">Investment Duration (Years):</label>
<input id="investmentDuration" placeholder="Enter investment duration" required="" type="text" />
</div>
<div class="form-group">
<input id="calculateBtn" type="submit" value="Calculate" />
</div>
</form>
<div id="result"></div>
</div>
<script>
document.getElementById('calculatorForm').addEventListener('submit', function (event) {
event.preventDefault();
calculateReturns();
});
function calculateReturns() {
var initialInvestment = parseFloat(document.getElementById('initialInvestment').value);
var annualReturn = parseFloat(document.getElementById('annualReturn').value);
var investmentDuration = parseFloat(document.getElementById('investmentDuration').value);
var futureValue = initialInvestment * Math.pow(1 + (annualReturn / 100), investmentDuration);
var resultElement = document.getElementById('result');
resultElement.innerHTML = "Future Value: $" + futureValue.toFixed(2);
}
</script>
</body>
</html>
ONLINE CALCULATOR CODE
<html>
<head>
<title>Online Calculator</title>
<style>
body {
font-family: Arial, sans-serif;
}
.calculator {
max-width: 300px;
margin: 0 auto;
background-color: #f5f5f5;
padding: 20px;
border-radius: 5px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}
.display {
background-color: #fff;
padding: 10px;
text-align: right;
margin-bottom: 10px;
font-size: 24px;
}
.buttons {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 10px;
}
button {
padding: 10px;
font-size: 18px;
text-align: center;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 3px;
cursor: pointer;
}
button.clear {
background-color: #f44336;
}
@media (max-width: 600px) {
.calculator {
max-width: 90%;
}
}
</style>
<script>
function calculate() {
var display = document.getElementById("display");
var result;
try {
result = eval(display.value);
display.value = result;
} catch (error) {
display.value = "Error";
}
}
function clearDisplay() {
document.getElementById("display").value = "";
}
function addToDisplay(value) {
document.getElementById("display").value += value;
}
</script>
</head>
<body>
<div class="calculator">
<input class="display" id="display" readonly="" type="text" />
<div class="buttons">
<button onclick="addToDisplay('7')">7</button>
<button onclick="addToDisplay('8')">8</button>
<button onclick="addToDisplay('9')">9</button>
<button onclick="addToDisplay('/')">/</button>
<button onclick="addToDisplay('4')">4</button>
<button onclick="addToDisplay('5')">5</button>
<button onclick="addToDisplay('6')">6</button>
<button onclick="addToDisplay('*')">*</button>
<button onclick="addToDisplay('1')">1</button>
<button onclick="addToDisplay('2')">2</button>
<button onclick="addToDisplay('3')">3</button>
<button onclick="addToDisplay('-')">-</button>
<button onclick="addToDisplay('0')">0</button>
<button onclick="addToDisplay('.')">.</button>
<button onclick="calculate()">=</button>
<button onclick="addToDisplay('+')">+</button>
<button class="clear" onclick="clearDisplay()">C</button>
</div>
</div>
</body>
</html>
DECIMAL TO TEXT CONVERTER CODE
<html>
<head>
<title>Decimal to Text Converter</title>
<script>
function convertToText() {
// Get the input value
var decimal = document.getElementById("decimal").value;
// Define arrays for text representation
var units = [
"", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten",
"eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen",
"eighteen", "nineteen"
];
var tens = [
"", "", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"
];
var scales = ["", "thousand", "million", "billion", "trillion"];
// Function to convert a three-digit number to text
function convertThreeDigitNumber(num) {
var result = "";
// Convert hundreds place
if (num >= 100) {
result += units[Math.floor(num / 100)] + " hundred ";
num %= 100;
}
// Convert tens and ones place
if (num >= 20) {
result += tens[Math.floor(num / 10)] + " ";
num %= 10;
}
// Convert ones place for numbers below 20
if (num > 0) {
result += units[num] + " ";
}
return result.trim();
}
// Convert the decimal number to text
var num = parseFloat(decimal);
var resultText = "";
if (num === 0) {
resultText = "zero";
} else {
var sign = num < 0 ? "negative " : "";
num = Math.abs(num);
var scaleIndex = 0;
while (num > 0) {
var chunk = num % 1000;
if (chunk !== 0) {
var chunkText = convertThreeDigitNumber(chunk);
resultText = chunkText + " " + scales[scaleIndex] + " " + resultText;
}
num = Math.floor(num / 1000);
scaleIndex++;
}
resultText = sign + resultText.trim();
}
// Display the result
document.getElementById("result").textContent = resultText;
}
</script>
</head>
<body>
<h1>Decimal to Text Converter</h1>
<label for="decimal">Enter a decimal number:</label>
<input id="decimal" type="text" />
<button onclick="convertToText()">Convert</button>
<p id="result"></p>
</body>
</html>
EMI CALCULATOR , fd returns with compound and simple intrest rate calculator , intrest rate calculator , emi , sip , mutual fund calculator , online calculator , decimal to text convertor code
Comments
Post a Comment