Jean-Christian Imbeault <[EMAIL PROTECTED]> wrote: 
> - Edwin wrote:
> > 
> > I guess it's because the number is converted automatically to an 
> > exponential notation if it goes over a certain number of digits--makes 
> > it easier to read...
> 
> I figured as much. But why? I found a solution by changing the precision 
> of floats in the php.ini file.
> 
> But I still find it strange that PHP will, internally, happily treat my 
> variable as a string but when it comes time to print it out, it decides 
> that it's a number and formats it without my asking it to.

Mmm, I'm not sure if I understand this correctly but I don't think PHP will "just 
decide" that your string IS a number and *formats* it.

Consider this:

<?php

  $var = 1111111111111111; // int
  $var2 = "1111111111111111"; // str
  echo $var; // echoes 1.11111111111E+015
  echo '<br />';
  echo $var2; // echoes 1111111111111111

?>

As you can see, PHP didn't "touch" the string version...

Anyway, I don't think the conversion to an exponential notation is peculiar to PHP--my 
math teacher required me to do the same :)

- E

__________________________________________________
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!  http://bb.yahoo.co.jp/


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

Reply via email to