Re: math - somethings wrong

From: Date: Wed, 16 May 2001 23:56:09 +0000
Subject: Re: math - somethings wrong
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-53125@lists.php.net to get a copy of this message
There are some comments below. I hope this will point you in the right direction. /* Yours :: $percentage=(($target_score/($fleet_score+$total_score))*.4)*100; */ /* From looking at the math you do on the calculator you may want to try this instead. */ $percentage=(($target_score/($fleet_score+$total_score)*.4))*100; /* or break it apart */ $divisor = ($fleet_score + $total_score) * .4; $divide = $target_score / divisor; $percentage = $divide * 100; if ($percentage >= 10) { $percentage='10'; $capped=$target_roids*($percentage/100); // Print the vars to check math! ;-) print("Percentage: $percentage | Capped: $capped"); } else { $capped=$target_roids*($percentage/100); // Print the vars to check math! ;-) print("Percentage: $percentage | Capped: $capped"); } Good Luck! Nathan Cook ncook@pcsedu.com

« previous php.general (#53125) next »