php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53507 json_encode of float value
Submitted: 2010-12-09 15:05 UTC Modified: 2010-12-11 16:08 UTC
From: johann at infomaniak dot ch Assigned: iliaa (profile)
Status: Closed Package: JSON related
PHP Version: 5.2.14 OS: Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: johann at infomaniak dot ch
New email:
PHP Version: OS:

 

 [2010-12-09 15:05 UTC] johann at infomaniak dot ch
Description:
------------
json_encode of float doesn't work when a locale is define which use comma (,) as separator (ex: fr_FR)


Test script:
---------------
$aReturn=array(
'fAmount' => 12.12
);

setlocale(LC_ALL, 'fr_FR');
print(json_encode($aReturn));

Expected result:
----------------
{"fAmount":12.12}

Actual result:
--------------
{"fAmount":12,12}

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-12-10 02:21 UTC] felipe@php.net
-Package: Systems problem +Package: JSON related
 [2010-12-11 16:08 UTC] iliaa@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: iliaa
 [2010-12-11 16:08 UTC] iliaa@php.net
Thank you for your bug report. This issue has already been fixed
in the latest released version of PHP, which you can download at 
http://www.php.net/downloads.php


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 15:01:29 2024 UTC