ID: 8097
Updated by: andy
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Closed
Bug Type: Strings related
Operating System: Linux (SuSE 7.0)
PHP Version: 4.0.3pl1
New Comment:

unable to reproduce with latest version of PHP, please
upgrade and re-open if still a problem.

Previous Comments:
------------------------------------------------------------------------

[2000-12-04 13:08:55] [EMAIL PROTECTED]

Changing the locale setting to a country that uses comma (,)
as the decimal seperator will stip off decimal places from
the float value in printf/sprintf. Example:

MySQL table:

        create table test (
            name varchar(100),
            value float(16,2)
        );

        insert into test values ('bla', 3.789);

PHP code:

        setlocale("LC_ALL", "de_DE");
        // mysql_connect etc.
        $row = mysql_fetch_array($result);
        printf("%s: %.2f",
            $row["name"], $row["value"]);

Result:

        bla: 3.00


------------------------------------------------------------------------



Edit this bug report at http://bugs.php.net/?id=8097&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to