|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-08-08 08:03 UTC] artur at 2i dot 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)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 20:00:01 2025 UTC |
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