php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32149 str_replace and decimal separator ','
Submitted: 2005-03-01 15:00 UTC Modified: 2005-03-01 18:39 UTC
From: alec at alec dot pl Assigned:
Status: Closed Package: Strings related
PHP Version: 5.0.2 OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: alec at alec dot pl
New email:
PHP Version: OS:

 

 [2005-03-01 15:00 UTC] 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

Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-01 18:39 UTC] iliaa@php.net
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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Sep 07 23:01:27 2024 UTC