|  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 Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
19 - 6 = ?
Subscribe to this entry?

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

Test script:
'fAmount' => 12.12

setlocale(LC_ALL, 'fr_FR');

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


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

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Thu Jun 08 05:03:37 2023 UTC