Author

Topic: Getting the "Current" ROI at the moment you have. (Read 623 times)

member
Activity: 73
Merit: 10
Bitcoin Supporter
Not sure what you're really asking for but ROI in your examples is simply gained by multiplying the daily  interest rate by the number of days.

So for eg. 1, ROI(%) is "daily interest" * "no.of days".
ie. 2.4*4 = 9.6%
The ROI expressed in bitcoin is 0.1*9.6/100


Thank you for the answer.
legendary
Activity: 2968
Merit: 3684
Join the world-leading crypto sportsbook NOW!
Not sure what you're really asking for but ROI in your examples is simply gained by multiplying the daily  interest rate by the number of days.

So for eg. 1, ROI(%) is "daily interest" * "no.of days".
ie. 2.4*4 = 9.6%
The ROI expressed in bitcoin is 0.1*9.6/100

member
Activity: 73
Merit: 10
Bitcoin Supporter

Hello. I am coding a project, where I must programatically determine how much ROI (Return of Investment) you have reached every day.
I just need the correct formula, not the code Smiley

For example:

Investment: 0.1 BTC
Daily Percent: 2.4%
Days: 4
Current ROI: Huh

OR

Investment: 0.25 BTC
Daily Percent: 2.4%
Days: 18
Current ROI: Huh

Currently what I managed to come up is:

Code:
$investment = 0.10;
$percent = 2.4;
$days = 10;
$earned = $investment + $days;
$ROI = ($investment * $earned) / 100;
?>

This formula gives me that ROI is: 0.1001% which can not be right. I would really appreciate for some1 to reveal the formula to calculate this (plain, not in code necesserally).

Jump to: