All Rounder Tools Blogger-Best blog for blogger: Discounted Cash Flow Calculator tool with colorful styling and all its features use any free library...

Sunday, September 22, 2024

Discounted Cash Flow Calculator tool with colorful styling and all its features use any free library...

 

Discounted Cash Flow Calculator

DCF Calculator

body { font-family: Arial, sans-serif; background: linear-gradient(135deg, #f8f9fa, #e9ecef); color: #333; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; } .container { background: white; padding: 20px; border-radius: 8px; box-shadow: 0 0 15px rgba(0, 0, 0, 0.2); text-align: center; width: 300px; } h1 { color: #007BFF; } .input-group { margin: 10px 0; } label { display: block; margin-bottom: 5px; } input { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 4px; font-size: 16px; } button { background-color: #28a745; color: white; padding: 10px 15px; border: none; border-radius: 4px; cursor: pointer; margin-top: 10px; transition: background-color 0.3s; font-size: 16px; } button:hover { background-color: #218838; } .result { margin-top: 20px; } #output { margin-top: 10px; padding: 10px; border: 1px solid #ddd; border-radius: 4px; background: #f9f9f9; } document.getElementById('calculateButton').addEventListener('click', function() { const cashFlow = parseFloat(document.getElementById('cashFlow').value); const discountRate = parseFloat(document.getElementById('discountRate').value) / 100; const years = parseInt(document.getElementById('years').value); const output = document.getElementById('output'); if (isNaN(cashFlow) || isNaN(discountRate) || isNaN(years) || years <= 0) { output.textContent = "Please enter valid values."; return; } const presentValue = cashFlow / Math.pow(1 + discountRate, years); output.textContent = `Present Value: $${presentValue.toFixed(2)}`; });

No comments:

Post a Comment