Free Compound Annual Growth Rate Calculator Tool: Easily Calculate Annual Growth Rate by Using this Tool

<!DOCTYPE html>
<html>
<head>
	<title>Compound Annual Growth Rate Calculator</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<style>
		body {
			font-family: Arial, sans-serif;
			padding: 20px;
		}

		h1 {
			text-align: center;
		}

		form {
			display: flex;
			flex-direction: column;
			align-items: center;
			margin-top: 20px;
		}

		label {
			display: block;
			margin-bottom: 5px;
			font-weight: bold;
		}

		input[type="number"] {
			width: 100%;
			padding: 10px;
			margin-bottom: 10px;
			border: 1px solid #ccc;
			border-radius: 5px;
			font-size: 16px;
			box-sizing: border-box;
		}

		button {
			background-color: #4CAF50;
			color: white;
			padding: 10px;
			border: none;
			border-radius: 5px;
			font-size: 16px;
			cursor: pointer;
			transition: background-color 0.3s ease;
		}

		button:hover {
			background-color: #3e8e41;
		}

		.result {
			margin-top: 20px;
			font-size: 18px;
			font-weight: bold;
		}
	</style>
</head>
<body>
	<h1>Compound Annual Growth Rate Calculator</h1>
	<form>
		<label for="starting-amount">Starting Amount:</label>
		<input type="number" id="starting-amount" placeholder="Enter starting amount" required>

		<label for="ending-amount">Ending Amount:</label>
		<input type="number" id="ending-amount" placeholder="Enter ending amount" required>

		<label for="years">Number of Years:</label>
		<input type="number" id="years" placeholder="Enter number of years" required>

		<button type="button" onclick="calculateCAGR()">Calculate CAGR</button>
	</form>

	<div class="result" id="result"></div>

	<script>
		function calculateCAGR() {
			var startingAmount = parseFloat(document.getElementById("starting-amount").value);
			var endingAmount = parseFloat(document.getElementById("ending-amount").value);
			var years = parseFloat(document.getElementById("years").value);

			var cagr = Math.pow((endingAmount / startingAmount), (1 / years)) - 1;
			var resultElement = document.getElementById("result");

			resultElement.innerHTML = "The Compound Annual Growth Rate is: " + (cagr * 100).toFixed(2) + "%";
		}
	</script>
</body>
</html>

Comments

  1. Our robust and durable tool storage solutions are crafted to meet the demanding needs of the modern manufacturing environment, offering reliable storage for all types of HSK holders.
    CNC Tool Storage for All HSK Holder Types
    Uratech USA Inc offers precision-engineered HSK CNC tool carts compatible with an extensive array of HSK holders

    ReplyDelete

Post a Comment

Popular posts from this blog

Convert Decimal code to Octal by Using this Tool

Text to PDF Generator Tool