Re: [PHP] Beware of round() function

2008-04-09 Thread Kirk . Johnson
On Mon, 24 Mar 2008 13:10:17 -0600, [EMAIL PROTECTED] wrote: Beware: round() apparently has changed its behavior from PHP 4. For certain special numbers that seem to be multiples of 100,000, the return value is in exponential format, rather than the usual decimal format. Some of these

Re: [PHP] Beware of round() function

2008-04-09 Thread Jim Lucas
[EMAIL PROTECTED] wrote: On Mon, 24 Mar 2008 13:10:17 -0600, [EMAIL PROTECTED] wrote: Beware: round() apparently has changed its behavior from PHP 4. For certain special numbers that seem to be multiples of 100,000, the return value is in exponential format, rather than the usual decimal

Re: [PHP] Beware of round() function

2008-03-26 Thread tedd
At 10:55 AM -0600 3/25/08, [EMAIL PROTECTED] wrote: Thanks for the info, Jeremy. Regardless of the technical details, my code still broke. I am little discouraged that an operation that should be so simple has these sorts of gotchas. Not that this helps/hurts your observation. What I find

Re: [PHP] Beware of round() function

2008-03-25 Thread Kirk . Johnson
Thanks for the info, Jeremy. Regardless of the technical details, my code still broke. I am little discouraged that an operation that should be so simple has these sorts of gotchas. BTW, I ended up casting to int as my solution. Kirk Jeremy Privett [EMAIL PROTECTED] wrote on 03/24/2008

[PHP] Beware of round() function

2008-03-24 Thread Kirk . Johnson
Beware: round() apparently has changed its behavior from PHP 4. For certain special numbers that seem to be multiples of 100,000, the return value is in exponential format, rather than the usual decimal format. Some of these special values are 120, 140, 230, which are returned as

Re: [PHP] Beware of round() function

2008-03-24 Thread Jeremy Privett
[EMAIL PROTECTED] wrote: Beware: round() apparently has changed its behavior from PHP 4. This is actually a change in the behavior of the float type, not the round function. Replace your round() with a cast to float and you'll see the exact same result. -- Jeremy Privett C.E.O. C.S.A. Omega

Re: [PHP] Beware of round() function

2008-03-24 Thread Jeremy Privett
Jeremy Privett wrote: [EMAIL PROTECTED] wrote: Beware: round() apparently has changed its behavior from PHP 4. This is actually a change in the behavior of the float type, not the round function. Replace your round() with a cast to float and you'll see the exact same result. Also, as a

Re: [PHP] Beware of round() function

2008-03-24 Thread Martín Marqués
On Mon, 24 Mar 2008 13:10:17 -0600, [EMAIL PROTECTED] wrote: Beware: round() apparently has changed its behavior from PHP 4. For certain special numbers that seem to be multiples of 100,000, the return value is in exponential format, rather than the usual decimal format. Some of these special