php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30159 format_string does not use LC_NUMERIC
Submitted: 2004-09-19 22:53 UTC Modified: 2004-09-22 05:13 UTC
From: richard at hirner dot at Assigned:
Status: Not a bug Package: *Languages/Translation
PHP Version: 4.3.7 OS: FreeBSD 5.2.1
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: richard at hirner dot at
New email:
PHP Version: OS:

 

 [2004-09-19 22:53 UTC] richard at hirner dot at
Description:
------------
One may expect number_format to behave localised and to use mon_thousands_sep and mon_decimal_point from localeconv().

See bug 12647, but not only for decimal points but also for thousands seperators.

Reproduce code:
---------------
setlocale(LC_ALL, "de");
print number_format(100000);

Expected result:
----------------
100.000

Actual result:
--------------
100,000

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-09-21 23:46 UTC] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Check the return value of setlocale(), I bet it\'s false because you simply don\'t have the \"de\" locale.
 [2004-09-22 00:17 UTC] richard at hirner dot at
That's strange because all other locale things I use are working & return expected results, including localeconv.
I do not know whether number_format SHOULD use locale settings or not, can you give me a hint?
 [2004-09-22 00:27 UTC] derick@php.net
Actually, it should not use it now that you ask. See the following example on how to use it:

http://talks.php.net/show/wereldveroverend-phpworks04/23

Derick
(and still not a bug :)
 [2004-09-22 05:13 UTC] richard at hirner dot at
Ok thanks. And you're sure that this behaviour shouldn't be changed? =)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 12:01:31 2024 UTC