Jump to content

[SOLVED] Function to remove E+


PJ droopy pants

Recommended Posts

Solved by simply removing the 'E' ? ? ? ?

 

Learn some basic mathematics.

 

Try running the following, and tell me which method actually displays the correct value.

$iString = '1.0497330552348E+16';

$iFloat1 = (float) $iString;

$iFloat2 = (float) preg_replace("/[[:^digit:]]/", '', $iString);

echo 'First Method gives '.number_format($iFloat1).'<br />';

echo 'Second Method gives '.number_format($iFloat2).'<br />';

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.