#32868 [Opn->Csd]: Although localeconv() reports , for decimal_point calculations fail
| From: | iliaa@php.net | Date: | Thu, 28 Apr 2005 15:35:30 +0000 |
| Subject: | #32868 [Opn->Csd]: Although localeconv() reports , for decimal_point calculations fail | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-78376@lists.php.net to get a copy of this message | ||
ID: 32868
Updated by: iliaa@php.net
Reported By: andy at laut dot de
-Status: Open
+Status: Closed
Bug Type: *General Issues
Operating System: SuSe Linux 9.2
PHP Version: 4.3.10
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2005-04-28 16:59:46] andy at laut dot de
Description:
------------
There seems to be a failure in internal number formating. Although my
locale is set correctly and localeconf returns the expected
information, which says, that decimal_point is the komma, calculations
with komma as decimal-separator fail.
Versions of PHP <4.3 behave as i expect, but since 4.3 scripts which
uses the komma for decimal-separator don't calculate correctly
anymore...
My Configure-Line:
'./configure' '--with-apxs=/www/apache-1.3.33/bin/apxs'
'--prefix=/www/apache-1.3.33/php-4.3.10' '--with-gd' '--with-zlib'
'--with-mysql' '--enable-trans-sid' '--enable-ftp'
'--with-mnogosearch=/www/mnogosearch'
Reproduce code:
---------------
#As anybody can see here, the locale is set correctly
setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
echo strftime ("%A %e %B %Y", mktime (0, 0, 0, 12, 22, 1978));
#localeconf returns the expected information
$locale_info = localeconv();
print_r($locale_info);
#But what the heck, this print doesn't
print("1,00+1,99=" . "1,00" + "1,99" . "<br/>\n");
/* If you uncomment this, parse error occurs
$x = 2,99;
$y = 3,27;
print($x+$y);
*/
Expected result:
----------------
Freitag 22 Dezember 1978
Array
(
[decimal_point] => ,
[thousands_sep] => .
[int_curr_symbol] => EUR
[currency_symbol] => ¤
[mon_decimal_point] => ,
[mon_thousands_sep] => .
[positive_sign] =>
[negative_sign] => -
[int_frac_digits] => 2
[frac_digits] => 2
[p_cs_precedes] => 0
[p_sep_by_space] => 1
[n_cs_precedes] => 0
[n_sep_by_space] => 1
[p_sign_posn] => 1
[n_sign_posn] => 1
[grouping] => Array
(
[0] => 3
[1] => 3
)
[mon_grouping] => Array
(
[0] => 3
[1] => 3
)
)
2,99
6,26
Actual result:
--------------
Freitag 22 Dezember 1978
Array
(
[decimal_point] => ,
[thousands_sep] => .
[int_curr_symbol] => EUR
[currency_symbol] => ¤
[mon_decimal_point] => ,
[mon_thousands_sep] => .
[positive_sign] =>
[negative_sign] => -
[int_frac_digits] => 2
[frac_digits] => 2
[p_cs_precedes] => 0
[p_sep_by_space] => 1
[n_cs_precedes] => 0
[n_sep_by_space] => 1
[p_sign_posn] => 1
[n_sign_posn] => 1
[grouping] => Array
(
[0] => 3
[1] => 3
)
[mon_grouping] => Array
(
[0] => 3
[1] => 3
)
)
2
5
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32868&edit=1