Re: [PHP] sprintf() oddity

2006-04-18 Thread Richard Lynch
On Tue, April 18, 2006 10:19 am, Chris Boget wrote: > What's going on here: > > $number = 50.1234567890; > echo sprintf( '%.05f', $number ); > > result: 50.12346 > > $number = 5.1234567890; > echo sprintf( '%.05f', $number ); > > result: 5.12305 > > $number =

Re: [PHP] sprintf() oddity

2006-04-18 Thread Satyam
You are going beyond the number of significant digits PHP can handle so it is truncating beyond that. In the second case it look sstrange, the 12305 ending, but it is probably a 'round' number if you put it in binary, but it turns funny when converted to decimal. In the last example, the pre