Bug #12647 Updated: sprintf, doubles and locale
| From: | hholzgra@php.net | Date: | Sun, 16 Jun 2002 13:13:53 +0000 |
| Subject: | Bug #12647 Updated: sprintf, doubles and locale | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-10737@lists.php.net to get a copy of this message | ||
ID: 12647
Updated by: hholzgra@php.net
Reported By: artur@2i.pl
-Status: Open
+Status: Closed
Bug Type: Strings related
PHP Version: 4.0.6
New Comment:
fixed in CVS
and
setlocale("LC_NUMERIC", "pl_PL");
echo sprintf("%.2f",1.25);
will soon work (again?), too
no need to use the doubleval() workaround anymore
Previous Comments:
------------------------------------------------------------------------
[2001-08-08 08:03:28] artur@2i.pl
sprintf ignores locale settings and always use . as the decimal
separator.
Try this:
setlocale("LC_NUMERIC", "pl_PL");
echo sprintf("%.2f",doubleval("1,25"));
Result:
1.25
(should be 1,25)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=12647&edit=1