#30176 [Opn->Bgs]: decimal printf output - padding error

From: Date: Tue, 21 Sep 2004 02:44:17 +0000
Subject: #30176 [Opn->Bgs]: decimal printf output - padding error
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-66475@lists.php.net to get a copy of this message
ID: 30176 User updated by: leroy at twisp-e dot com Reported By: leroy at twisp-e dot com -Status: Open +Status: Bogus Bug Type: Output Control Operating System: w2k PHP Version: 4.3.8 New Comment: I figured out the problem. I was echoing the output of printf. using echo printf("%07d",$value) gives 00value7 using printf("%07d",$value)gives 00value Sorry. Previous Comments: ------------------------------------------------------------------------ [2004-09-21 03:06:14] leroy at twisp-e dot com Description: ------------ Is this a bug? PHP 4.3.8 printf("%07d", $value) produces "00value7" e.g., if $value=123 , output is "00001237" I expected "00value" printf("%06d", $value) produces "0value6" I expected "0value" Am i missing something here? ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=30176&edit=1

« previous php.bugs (#66475) next »