[TYPO3-mvc] Map numeric values with thousands separators to float properties

roberto blanko robertoblanko at gmail.com
Tue Feb 1 15:32:44 CET 2011


Hello, hello!

let's say I have a create action fed by a Fluid form containing fields like
this:

<f:form.textbox property="price" value="47.222,11" size="5" />

The property "price" is of type float and is being mapped automatically
thanks to Extbasish magic. However if the user uses thousands separators
like in the example above, Extbase (or Fluid?) seems to interpret decimal
separators only.

In my test cases the following input values led to the following property
values:

47222,11 => 47222.11 (Yes!)
47222.11 => 47222.11 (Yes!)
47.222,11 => 47.22211 (No!)

I don't want the last case to happen. Is there a nice way to influence how
Extbase (or is it Fluid?) maps values to properties?

Thanks in advance!


More information about the TYPO3-project-typo3v4mvc mailing list