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
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: 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: Sun Dec 22 02:01:28 2024 UTC