Project

General

Profile

Actions

Bug #75141

closed

config.locale_all does not set LC_ALL

Added by Christian Welzel about 8 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2016-03-16
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Using the following code in my php code i get not the correct output:

$s = sprintf("%.2f", 5.00);

config.locale_all is set to "de_DE.utf-8", so i would expect sprintf to return "5,00" but "5.00" is returned.
Looking into TypoScriptFrontendController.php::settingLocale() reveals, that only LC_CTYPE, LC_MONETARY and LC_TIME are set
to the value given to locale_all. But not LC_NUMERIC.

A comment in the file says: There's a problem that PHP parses float values in scripts wrong if the locale LC_NUMERIC is set
to something with a comma as decimal point Do we set all except LC_NUMERIC

Is this still true in PHP 5.5+?
If yes, than documentation should be updated, as it says "PHP: setlocale(“LC_ALL”, [value]);"
If not, the code should be updated to set LC_ALL instead of only a subset.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #75780: Invalid number format because of miscellaneous decimal separatorClosedNicole Cordes2016-04-19

Actions
Actions

Also available in: Atom PDF