Heyz!
I am here building a Bitcoin Website, but I stumbled across an issue. I need to make a PHP Formula, which returns
CURRENT ROI (Percentage) for the moment.
For example: 100$ Investment and CURRENTLY earned 42$.
I need a formula, so I can programmatically calculate the ROI Percentage.
I did ofcourse try myself different version how I could achieve it, in a simple tests:
<?
$investment = 100;
$percent = 2.4;
$earned = 50;
$ROI = ($investment - $earned)/$investment; // Formula
echo 'Investment: '.$investment.'$<br />Percent: '.$percent.'%<br />Earned: '.$earned.'$<br /><b>ROI: '.$ROI.'%</b>';
?>
Please help me with the right formula. I am very bad when it comes to Percentage calcs.. ^^