|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-08-06 08:33 UTC] yohgaki@php.net
-Status: Open
+Status: Wont fix
-Package: Feature/Change Request
+Package: *General Issues
[2013-08-06 08:33 UTC] yohgaki@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 20 19:00:01 2025 UTC |
Description: ------------ When I use locales and convert a string to float, I get a truncated value, eg: // comma as a decimal separator setlocale(LC_ALL,'pl_PL'); $b = "1,2"; $c = $b*2; echo $c; // php 4.2 >>> 2,4 // php >= 4.3 >>> 2 (without any warning) In php 4.2 (5.x) you used a strtod function. Now you use our zend_strtod function which ignores locales. This truncating should be reported as a warning. My suggest is: Zend/zend_strtod.c, line: 1290: if (c == ',') zend_error(E_WARNING, "Convert string to double: wrong decimal point, only . (truncate number %s)", s00); Thanks in advance for adding this feature in the new version. Expected result: ---------------- Loging warning or notice if lose precision.