Author

Topic: How to calculate ROI (Read 505 times)

sr. member
Activity: 1039
Merit: 250
BabelFish - FISH Token Sale at Sovryn
April 24, 2017, 12:30:11 AM
#4
Wait a second. I just tried to use this formula, and I think it might work.. but I need a confirmation from expert..

Code:
$ROI = ($investment * $earned)/100;

try this formula  Smiley

Code:
%ROI = ($earned * 100) / $Investment

i saw a few investments program use that formula
remember the ROI is in percent (%) not in $

regards
hero member
Activity: 1204
Merit: 531
Metaverse 👾 Cyberweapons
April 23, 2017, 09:35:20 AM
#3
Wait a second. I just tried to use this formula, and I think it might work.. but I need a confirmation from expert..

Code:
$ROI = ($investment * $earned)/100;

I think, it is

Code:
(($earned - $investment) / $investment)

, which gives a non-percent value.

And the percent value is

Code:
(($earned - $investment) / $investment) * 100

Where earned is the amount you have after earning...
member
Activity: 129
Merit: 24
Professional Developer
April 22, 2017, 10:27:30 AM
#2
Wait a second. I just tried to use this formula, and I think it might work.. but I need a confirmation from expert..

Code:
$ROI = ($investment * $earned)/100;
member
Activity: 129
Merit: 24
Professional Developer
April 22, 2017, 10:20:27 AM
#1
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:

Code:
$investment = 100;
$percent = 2.4;
$earned = 50;
$ROI = ($investment - $earned)/$investment; // Formula
echo 'Investment: '.$investment.'$
Percent: '.$percent.'%
Earned: '.$earned.'$
ROI: '.$ROI.'%';
?>

Please help me with the right formula. I am very bad when it comes to Percentage calcs.. ^^
Jump to: