how to make a project complete estimation in %
kinda like this :
Total Project = 10 Finished Project = 3
So I got 70% done.. etc.
this one is easy because it's only 10 project, how if I had 8,12,90,120 projects. can someone let me know
This is just simple math:
100 - ( ( finished project / total project) * 100 )
So
100 - (3 / 10) * 100) = 70
actually it's not working.. I got Warning: Division by zero in /u1/hosts/thorloki/www/login/admin/projects_script.php on line 449
when
100 - (0 / 0) * 100) = Warning
Use an if statement.
$finish = //your finished project $total = //your total project\ if($finish >= "1" && $total >= "1") { //do the work here } else { exit(); }
Remember, you can't divide by 0. That means "total project" must be greater than 0 or PHP will rightfully complain.