<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Discounted Cash Flow Calculator</title> <style> body { font-family: Arial, sans-serif; background-color: #f7f7f7; margin: 0; padding: 0; } #wrapper { max-width: 700px; margin: 0 auto; padding: 20px; background-color: #fff; box-shadow: 0 0 10px rgba(0,0,0,0.1); } h1 { text-align: center; } label { display: block; margin-bottom: 5px; } input[type="number"] { width: 100%; padding: 8px; border-radius: 5px; border: none; margin-bottom: 10px; } button[type="submit"] { background-color: #4CAF50; color: #fff; border: none; padding: 10px; border-radius: 5px; cursor: pointer; } button[type="submit"]:hover { background-color: #3e8e41; } #result { margin-top: 20px; font-size: 24px; text-align: center; } </style> </head> <body> <div id="wrapper"> <h1>Discounted Cash Flow Calculator</h1> <form onsubmit="return calculateDiscountedCashFlow()"> <label for="initialInvestment">Initial Investment</label> <input type="number" id="initialInvestment" required> <label for="cashFlows">Cash Flows</label> <textarea id="cashFlows" rows="5" required></textarea> <label for="discountRate">Discount Rate (%)</label> <input type="number" id="discountRate" required> <button type="submit">Calculate Discounted Cash Flow</button> </form> <div id="result"></div> </div> <script> function calculateDiscountedCashFlow() { var initialInvestment = document.getElementById("initialInvestment").value; var cashFlows = document.getElementById("cashFlows").value.split('\n'); var discountRate = document.getElementById("discountRate").value; var discountedCashFlow = parseInt(initialInvestment); for (var i = 0; i < cashFlows.length; i++) { discountedCashFlow += parseInt(cashFlows[i]) / Math.pow(1 + (discountRate / 100), i+1); } document.getElementById("result").innerHTML = "Discounted Cash Flow: รข‚¹" + discountedCashFlow.toFixed(2); return false; } </script> </body> </html>
Discover a collection of free HTML tools to enhance your web development skills. Create amazing websites and boost your productivity with these valuable resources."
Sunday, May 7, 2023
100% Free Discounted Cash Flow Calculator Tool: Easily Calculate Discounted Cashflow by Using this Tool and Earn Money Online
Subscribe to:
Post Comments (Atom)
100% Free Language Translator Tool: Easily Translate Language by Using this Tool
Language Translator Language Translator Source Language: Afrikaans Albanian Amharic ...
No comments:
Post a Comment