ID: 25246 Updated by: [EMAIL PROTECTED] Reported By: david at boe dot es -Status: Open +Status: Bogus Bug Type: Scripting Engine problem Operating System: linux PHP Version: 4.3.2 New Comment:
For the same reason as stated before in the urls you gave. Previous Comments: ------------------------------------------------------------------------ [2003-08-26 05:04:05] david at boe dot es Description: ------------ As stated in http://bugs.php.net/bug.php?id=17079 and http://news.php.net/article.php?group=php.dev&article=95211 , PHP always resets decimal_point to "." besides your locale "decimal_point". This breaks backward compatibility, at least with PHP 4.2.3 This is BAD as long as we use na Oracle database with NLS_LANG=Spanish_Spain.WE8ISO8859P1 , needed to output regional chars like � and �����. This means that all operations with numerical values returned by a database query (decimal part separated by ',') are broken now. In my linux: [EMAIL PROTECTED] root]# export LANG=es_ES [EMAIL PROTECTED] root]# locale -k decimal_point decimal_point="," The script: <?php setlocale(LC_ALL, 'es_ES'); $locale_info = localeconv(); echo "decimal_point: {$locale_info["decimal_point"]}\n"; $value1="1.5"; $value2="1,5"; $res1=$value1*1; $res2=$value2*1; echo "Res 1 : $res1 \n"; echo "Res 2 : $res2 \n"; ?> outputs: decimal_point: . Res 1 : 1,5 Res 2 : 1 Reproduce code: --------------- In my linux: [EMAIL PROTECTED] root]# export LANG=es_ES [EMAIL PROTECTED] root]# locale -k decimal_point decimal_point="," The script: <?php setlocale(LC_ALL, 'es_ES'); $locale_info = localeconv(); echo "decimal_point: {$locale_info["decimal_point"]}\n"; $value1="1.5"; $value2="1,5"; $res1=$value1*1; $res2=$value2*1; echo "Res 1 : $res1 \n"; echo "Res 2 : $res2 \n"; ?> outputs: decimal_point: . Res 1 : 1,5 Res 2 : 1 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=25246&edit=1
