#28738 [Opn->Bgs]: printf formatting bug

From: Date: Fri, 11 Jun 2004 13:30:56 +0000
Subject: #28738 [Opn->Bgs]: printf formatting bug
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-60785@lists.php.net to get a copy of this message
ID: 28738 Updated by: iliaa@php.net Reported By: mark at islandnet dot com -Status: Open +Status: Bogus Bug Type: *General Issues Operating System: FreeBSD 4.10 PHP Version: 4.3.7 New Comment: Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely to be the same. Thank you for your interest in PHP. Dupe of bug #28633 Previous Comments: ------------------------------------------------------------------------ [2004-06-11 06:07:06] mark at islandnet dot com Confirmed that this bug was not in 4.3.6 or 4.3.4 (the only other versions I have handy). Also, I have it backwards. The first line (zero.something) is correct, it's the second line of output that is missing 4 spaces. Previous versions of PHP output both lines with the same spacing as the second line of this example. ------------------------------------------------------------------------ [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 (#60785) next »