#28738 [Opn]: printf formatting bug

From: Date: Fri, 11 Jun 2004 04:05:34 +0000
Subject: #28738 [Opn]: printf formatting bug
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-60761@lists.php.net to get a copy of this message
ID: 28738 User updated by: mark at islandnet dot com Reported By: mark at islandnet dot com Status: Open Bug Type: *General Issues Operating System: FreeBSD 4.10 PHP Version: 4.3.7 New Comment: . Previous Comments: ------------------------------------------------------------------------ [2004-06-11 05:46:10] mark at islandnet dot com Description: ------------ Width formatting of %f values is buggy when the value is zero point something. Reproduce code: --------------- <? printf( "[%10.3f]\n", 0.5 ); printf( "[%10.3f]\n", 1.5 ); ?> Expected result: ---------------- [ 0.500] [ 1.500] That is: same overall width for both is expected. Actual result: -------------- [ 0.500] [ 1.500] Note the 4 extra spaces in the first line! ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=28738&edit=1

« previous php.bugs (#60761) next »