Keeping it on one line doesn't affect the calculations (as it shouldn't). Try using either sprintf() or number_format() for this purpose (the latter is generally preferred, but I don't know exactlt what you're after).

Bogdan

Zavaboy wrote:

How do I prevent a long float number end up like this after/during a
calculation?

8.5E-05 //A number error occurs.

I even tried keeping the whole calculation in 1 line:

//Get the weight (in pounds) of a O-Ring.
$N = round((0.03613 * 1.85 * ((pow(pi(), 2) * pow(($iDia[$d] - $oDia[$d]),
2) * ($iDia[$d] + $oDia[$d])) / 32)), 6);

Thanks in advance!



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to