Ask a Question related to PHP Bugs, Design and Development.
-
ipa at beta dot lt #1
#39830 [NEW]: Incorrect (float) variable output after using setlocale
From: ipa at beta dot lt
Operating system: Linux 2.6.10
PHP version: 4.4.4
PHP Bug Type: Variables related
Bug description: Incorrect (float) variable output after using setlocale
Description:
------------
Strange behaviour on float variable output after using setlocale()
function.
Reproduce code:
---------------
<?php
setlocale(LC_NUMERIC, 'lt_LT');
$xxx = 19.48;
echo ($xxx) . "\n"; // Output float from variable
echo (19.48) . "\n"; // Output float directly
?>
Expected result:
----------------
19,48
19,48
Actual result:
--------------
19,48
19.48
--
Edit bug report at [url]http://bugs.php.net/?id=39830&edit=1[/url]
--
Try a CVS snapshot (PHP 4.4): [url]http://bugs.php.net/fix.php?id=39830&r=trysnapshot44[/url]
Try a CVS snapshot (PHP 5.2): [url]http://bugs.php.net/fix.php?id=39830&r=trysnapshot52[/url]
Try a CVS snapshot (PHP 6.0): [url]http://bugs.php.net/fix.php?id=39830&r=trysnapshot60[/url]
Fixed in CVS: [url]http://bugs.php.net/fix.php?id=39830&r=fixedcvs[/url]
Fixed in release: [url]http://bugs.php.net/fix.php?id=39830&r=alreadyfixed[/url]
Need backtrace: [url]http://bugs.php.net/fix.php?id=39830&r=needtrace[/url]
Need Reproduce Script: [url]http://bugs.php.net/fix.php?id=39830&r=needscript[/url]
Try newer version: [url]http://bugs.php.net/fix.php?id=39830&r=oldversion[/url]
Not developer issue: [url]http://bugs.php.net/fix.php?id=39830&r=support[/url]
Expected behavior: [url]http://bugs.php.net/fix.php?id=39830&r=notwrong[/url]
Not enough info: [url]http://bugs.php.net/fix.php?id=39830&r=notenoughinfo[/url]
Submitted twice: [url]http://bugs.php.net/fix.php?id=39830&r=submittedtwice[/url]
register_globals: [url]http://bugs.php.net/fix.php?id=39830&r=globals[/url]
PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=39830&r=php3[/url]
Daylight Savings: [url]http://bugs.php.net/fix.php?id=39830&r=dst[/url]
IIS Stability: [url]http://bugs.php.net/fix.php?id=39830&r=isapi[/url]
Install GNU Sed: [url]http://bugs.php.net/fix.php?id=39830&r=gnused[/url]
Floating point limitations: [url]http://bugs.php.net/fix.php?id=39830&r=float[/url]
No Zend Extensions: [url]http://bugs.php.net/fix.php?id=39830&r=nozend[/url]
MySQL Configuration Error: [url]http://bugs.php.net/fix.php?id=39830&r=mysqlcfg[/url]
ipa at beta dot lt Guest
-
#40423 [NEW]: -INF float session variable
From: jwprox at hotmail dot com Operating system: OSX 10.4 PHP version: 4.4.4 PHP Bug Type: Session related Bug description:... -
#8097 [Com]: printf() and float data vs.setlocale()
ID: 8097 Comment by: essen at dev-extend dot eu Reported By: hh at loca dot net Status: No Feedback Bug Type: ... -
#24640 [Asn->Csd]: var_export and var_dump can't output large float
ID: 24640 Updated by: helly@php.net Reported By: gharman at erols dot com -Status: Assigned +Status: ... -
#24640 [Opn->Asn]: var_export and var_dump can't output large float
ID: 24640 Updated by: sniper@php.net Reported By: gharman at erols dot com -Status: Open +Status: ... -
#24640 [NEW]: var_export and var_dump can't output large float
From: gharman at erols dot com Operating system: XP & Linux PHP version: 4.3.2 PHP Bug Type: Variables related Bug... -
tony2001@php.net #2
#39830 [Opn->Fbk]: Incorrect (float) variable output after using setlocale
ID: 39830
Updated by: [email]tony2001@php.net[/email]
Reported By: ipa at beta dot lt
-Status: Open
+Status: Feedback
Bug Type: Variables related
Operating System: Linux 2.6.10
PHP Version: 4.4.4
New Comment:
Please try using this CVS snapshot:
[url]http://snaps.php.net/php4-STABLE-latest.tar.gz[/url]
For Windows:
[url]http://snaps.php.net/win32/php4-win32-STABLE-latest.zip[/url]
Cannot reproduce.
Previous Comments:
------------------------------------------------------------------------
[2006-12-14 09:58:01] ipa at beta dot lt
Description:
------------
Strange behaviour on float variable output after using setlocale()
function.
Reproduce code:
---------------
<?php
setlocale(LC_NUMERIC, 'lt_LT');
$xxx = 19.48;
echo ($xxx) . "\n"; // Output float from variable
echo (19.48) . "\n"; // Output float directly
?>
Expected result:
----------------
19,48
19,48
Actual result:
--------------
19,48
19.48
------------------------------------------------------------------------
--
Edit this bug report at [url]http://bugs.php.net/?id=39830&edit=1[/url]
tony2001@php.net Guest



Reply With Quote

