Please report this bug at http://bugs.php.net/ categorizing the bug as
a documentation problem. Thanks.

Goba

----- Original Message -----
From: "Jim Mercer" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, October 18, 2002 3:32 PM
Subject: [PHP-DOC] differences in printf() between php and C


>
> not sure if anyone has pointed this out, but it would be nice if it was
noted
> in the printf() manpage.
>
> in standard C, the format "%10.2f" means show 10 characters, of which the
> last 3 are decimal point and 2 digits.  ie. the total length is 10 chars.
>
> in php, it appears that "%10.2f" means show 10 whole number digits,
followed
> by a decimal point and two digits.
>
> in C:   printf("[10.2f]", 99.99);  == [     99.99]
> in PHP: printf("[10.2f]", 99.99);  == [        99.99]
>
> while i wouldn't expect PHP to "fix" their printf(), this difference
should
> be noted, as it definitely causes C programmers to skew their alignment.
>
> --
> [ Jim Mercer        [EMAIL PROTECTED]         +1 416 410-5633 ]
> [          I want to live forever, or die trying.            ]
>
> --
> PHP Documentation Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 
PHP Documentation Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to