3.75 Interest Rate Calculator

Return on Investment (ROI) Calculator

Understanding your Return on Investment (ROI) is crucial for evaluating the profitability of any investment. ROI measures the gain or loss generated on an investment relative to its cost. It's typically expressed as a percentage.

How to Calculate ROI:

The basic formula for ROI is:

ROI = ((Current Value of Investment – Cost of Investment) / Cost of Investment) * 100

Where:

  • Current Value of Investment: The present market value of your investment.
  • Cost of Investment: The total amount spent to acquire the investment, including initial purchase price, fees, and any additional capital put into it.

A positive ROI indicates a profitable investment, while a negative ROI signifies a loss.





function calculateROI() { var costOfInvestment = parseFloat(document.getElementById("cost-of-investment").value); var currentValue = parseFloat(document.getElementById("current-value").value); var resultDiv = document.getElementById("result"); if (isNaN(costOfInvestment) || isNaN(currentValue)) { resultDiv.innerHTML = "Please enter valid numbers for both fields."; return; } if (costOfInvestment === 0) { resultDiv.innerHTML = "Cost of Investment cannot be zero."; return; } var profitOrLoss = currentValue – costOfInvestment; var roi = (profitOrLoss / costOfInvestment) * 100; if (roi >= 0) { resultDiv.innerHTML = "Your Return on Investment (ROI) is: " + roi.toFixed(2) + "% (Profit)"; } else { resultDiv.innerHTML = "Your Return on Investment (ROI) is: " + roi.toFixed(2) + "% (Loss)"; } }

Leave a Comment