Project

General

Profile

Actions

Bug #75920

closed

Extbase generic persistence casting float value to string causes wrong values if system locale is german

Added by Philipp Wrann almost 8 years ago. Updated almost 8 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Extbase
Target version:
Start date:
2016-04-26
Due date:
% Done:

0%

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

Description

When setting a float property to 45.5 and persisting it via extbase on a system with locale=de the resulting string will be 45,5, that results in a stored value of 45.0 in the database.

this should be taken into account explicitly in the ObjectMapper::getPlainValue method.

If the input is of type float, we may have to string replace comma by dots or use some Utility class to cast the float value.

number_format($value, $precision, ".", "") could also do the job, to get the precision the sql would have to be evaluated when building the column map, so maybe str_replace(",", ".", (string) $value) would be the easiest solution.

My system runs php5.6 and system locale is de_DE.UTF-8

I will install the german locale also on production machine to enable german date formats etc. So this is gonna be a problem.


Related issues 2 (0 open2 closed)

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

Actions
Is duplicate of TYPO3 Core - Bug #75825: validate and set float propertiesClosed2016-04-20

Actions
Actions #1

Updated by Philipp Wrann almost 8 years ago

could someone fix the typo in the title please? locate^locale

Actions #2

Updated by Mathias Brodala almost 8 years ago

  • Status changed from New to Closed

This has been fixed (but not released yet) in the meantime, see #75780 and #75825 but thanks for reporting.

Actions #3

Updated by Mathias Brodala almost 8 years ago

  • Subject changed from Extbase generic persistence casting float value to string causes wrong values if system locate is german to Extbase generic persistence casting float value to string causes wrong values if system locale is german
Actions

Also available in: Atom PDF