#46621 [Opn->Bgs]: Float conversion in french breaks PHP
| From: | jani@php.net | Date: | Wed, 19 Nov 2008 23:10:22 +0000 |
| Subject: | #46621 [Opn->Bgs]: Float conversion in french breaks PHP | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-131126@lists.php.net to get a copy of this message | ||
ID: 46621
Updated by: jani@php.net
Reported By: php dot net at spam dot lublink dot net
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
Operating System: Gentoo Linux
PHP Version: 5.2.6
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.
Enough with the setlocale() and float "bug" reports..
Previous Comments:
------------------------------------------------------------------------
[2008-11-19 19:32:53] php dot net at spam dot lublink dot net
Description:
------------
In French, it is written "0,05" not "0.05". When in French, converting
a string to a float causes values to be truncated.
I have two servers that I tested this on. One is running Gentoo, the
other is running Ubuntu.
Reproduce code:
---------------
<?php
setlocale(LC_ALL, 'fr_FR');
var_dump ( (string)(float) "0.01" ) ;
var_dump ( (float)(string)(float)(string)(float) "0.01" ) ;
?>
Expected result:
----------------
string(4) "0,01"
float(0,01)
Actual result:
--------------
string(4) "0,01"
float(0)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46621&edit=1