Bug #67127 [Asn->Nab]: setlocale LC_NUMERIC breaks DateTime microseconds

From: Date: Mon, 05 Apr 2021 15:46:14 +0000
Subject: Bug #67127 [Asn->Nab]: setlocale LC_NUMERIC breaks DateTime microseconds
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-233169@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67127&edit=1 ID: 67127 Updated by: derick@php.net Reported by: honzap at gmail dot com Summary: setlocale LC_NUMERIC breaks DateTime microseconds -Status: Assigned +Status: Not a bug Type: Bug Package: Date/time related Operating System: Linux (Debian Wheezy) PHP Version: 5.4.27 Assigned To: derick Block user comment: N Private report: N New Comment: Thank you for taking the time to report a problem with PHP. Unfortunately you are not using a current version of PHP -- the problem might already be fixed. Please download a new PHP version from http://www.php.net/downloads.php If you are able to reproduce the bug with one of the latest versions of PHP, please change the PHP version on this bug report to the version you tested and change the status back to "Open". Again, thank you for your continued support of PHP. This appears to have been fixed in PHP 7.2 already. Previous Comments: ------------------------------------------------------------------------ [2020-03-18 08:42:55] cmb@php.net > This is related to the problem that double conversion does not > work with LC_NUMERIC=cs_CZ.utf8 (or some other locale with , as > decimal point like de_DE.utf8). To be clear, double to string conversion works as intended for any locale; it's just not the most sensible behavior[1]. Anyhow, this bug is not about that issue (see originally supplied test script). [1] <https://wiki.php.net/rfc/locale_independent_float_to_string> ------------------------------------------------------------------------ [2018-04-07 18:38:20] cmb@php.net Related To: Bug #76190 ------------------------------------------------------------------------ [2017-12-11 15:28:14] thflori at gmail dot com This is related to the problem that double conversion does not work with LC_NUMERIC=cs_CZ.utf8 (or some other locale with , as decimal point like de_DE.utf8). Test script: ------------ echo (double)'0.42'; setlocale(LC_NUMERIC, 'de_DE.utf8'); echo (double)'0.42'; Expected Output: ---------------- 0.42 0,42 Actual Output: -------------- 0.42 0,42.0 ------------------------------------------------------------------------ [2016-08-07 10:09:11] cmb@php.net Related To: Bug #48225 ------------------------------------------------------------------------ [2016-08-07 09:52:22] cmb@php.net Related To: Bug #47312 ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=67127 -- Edit this bug report at https://bugs.php.net/bug.php?id=67127&edit=1

« previous php.bugs (#233169) next »