Bug #1259 Updated: Double in a string comparision bug after converting with strval and intval

From: Date: Tue, 23 Mar 1999 12:41:11 +0000
Subject: Bug #1259 Updated: Double in a string comparision bug after converting with strval and intval
Groups: php.dev 
Request: Send a blank email to php-dev+get-4741@lists.php.net to get a copy of this message
ID: 1259 Updated by: zeev Reported By: mlemos@acm.org Status: Closed Bug Type: Compile Failure Assigned To: Comments: That example is way too cryptic. I doubt there is a bug here, but if there is, demonstrate it in a simple and concise manner instead of this gobblygook. --- The behavior you claim you see is indeed existant, but it's not a bug, but an intended behavior. A much shorter and elegant way to demonstrate the bug in its essence, would be: print (string) 1.; which would, in turn, generate the output: 1 and same goes for print (string) 1.0000; PHP's string conversion routines supress any trailing zeros, very much on purpose. If you want to force a certain amount of decimal digits, use printf() or sprintf() instead of echo or print. Full Bug description available at: http://ca.php.net/bugs.php3?id=1259 -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#4741) next »