View Single Post
Old 04-20-2005, 11:26 AM  
Varius
Confirmed User
 
Industry Role:
Join Date: Jun 2004
Location: New York, NY
Posts: 6,890
PHP: How do you convert from EXPONENT_DNUM to LNUM format??

I'm having a very annoying problem this morning....

If I increment a variable by small floats (like 0.00001 lets say) in a loop, the vairable becomes EXPONENT_DNUM format. I would like to keep it in LNUM format. Any ideas?

I've made a simple loop here to show an example:

PHP Code:
<?PHP

$var 
0;

for (
$i=0;$i<5;$i++) {
    
$var += 0.000004;
}

echo 
$var;

?>
That gives me "2E-05" instead of the 0.00002 I"m looking for.
__________________
Skype variuscr - Email varius AT gmail
Varius is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote