Re: A long float number.
| From: | Bogdan Stancescu | Date: | Fri, 01 Aug 2003 22:02:55 +0000 |
| Subject: | Re: A long float number. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-158013@lists.php.net to get a copy of this message | ||
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!