#32149 [Opn->Csd]: str_replace and decimal separator ','
ID: 32149
Updated by: iliaa@php.net
Reported By: alec at alec dot pl
-Status: Open
+Status: Closed
Bug Type: Strings related
PHP Version: 5.0.2
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2005-03-01 15:00:40] alec at alec dot pl
Description:
------------
in polish locale decimal separator of floats is ','
When I wanna to replace some string with some float, it returns string
with '.' separator, but should be ','
Reproduce code:
---------------
setlocale(LC_NUMERIC,'pl_PL.UTF-8');
$value = 11.11;
echo round($value,2)."-";
$str = '?';
echo str_replace('?',round($value,2),$str);
Expected result:
----------------
11,11-11,11
Actual result:
--------------
11,11-11.11
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32149&edit=1
Thread (2 messages)