Well, that's the easiest way I can describe it.
I have a block of code that checks to see whether feet, miles or inches are greater than 0.
$inches = $winnerArray["points"]/72;
$feet = $inches/12;
$miles = $feet/5280;
print "I:".$inches."<br />F:".$feet."<br />M:".$miles."<br />";
if ($inches > 0 && $feet > 0 && $miles > 0) {
$points = number_format($miles,2,".","")." Miles";
} elseif ($inches > 0 && $feet > 0 && $miles < 0) {
$points = number_format($feet,2,".","")." Feet";
} elseif ($inches > 0 && $feet < 0 && $miles < 0) {
$points = number_format($inches,2,".","")." Inches";
}
Sample numbers would be something like the following:
Inches: 145.63888888889
Feet: 12.136574074074
Miles: 0.0022985935746352
No matter what happens, The loop always comes out with the Miles part.
Now, I'm probably stupidly tired, but I can't see anything wrong with the code above, but it just always comes out as miles.
Your help is appreciated.