This calculator is widely used in various industries, including finance, real estate, and corporate valuation, to make informed investment decisions. With the ability to incorporate complex financial models, a discounted cash flow calculator provides accurate and reliable valuations, helping investors identify undervalued assets or determine an appropriate price for a potential acquisition. It is an essential tool for financial analysts, investors, and businesses seeking to evaluate investment opportunities based on their expected future cash flows."
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Discounted Cash Flow Calculator</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<style>
.container {
max-width: 400px;
margin: 50px auto;
}
.form-group label {
font-weight: bold;
}
.result {
margin-top: 20px;
}
</style>
</head>
<body>
<div class="container">
<h1>Discounted Cash Flow Calculator</h1>
<form id="dcfForm">
<div class="form-group">
<label for="cashFlow">Cash Flow:</label>
<input type="number" class="form-control" id="cashFlow" required>
</div>
<div class="form-group">
<label for="discountRate">Discount Rate (%):</label>
<input type="number" class="form-control" id="discountRate" required>
</div>
<div class="form-group">
<label for="years">Years:</label>
<input type="number" class="form-control" id="years" required>
</div>
<button type="submit" class="btn btn-primary">Calculate</button>
</form>
<div class="result">
<h3>Present Value:</h3>
<p id="presentValue"></p>
</div>
</div>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<script>
document.getElementById('dcfForm').addEventListener('submit', function (e) {
e.preventDefault();
var cashFlow = parseFloat(document.getElementById('cashFlow').value);
var discountRate = parseFloat(document.getElementById('discountRate').value);
var years = parseInt(document.getElementById('years').value);
var presentValue = calculatePresentValue(cashFlow, discountRate, years);
document.getElementById('presentValue').textContent = presentValue.toFixed(2);
});
function calculatePresentValue(cashFlow, discountRate, years) {
var presentValue = cashFlow / Math.pow(1 + discountRate / 100, years);
return presentValue;
}
</script>
</body>
</html>
No comments:
Post a Comment