Am I using this right? For a float value. 12,12
get rejected, 12.12
does not. I want the opposite to be true.
@Flow\Validate(type="Number", options={ "locale"="de_DE" })
Reference here (but no usage example ><)
Am I using this right? For a float value. 12,12
get rejected, 12.12
does not. I want the opposite to be true.
@Flow\Validate(type="Number", options={ "locale"="de_DE" })
Reference here (but no usage example ><)
Actually validation is too late. What you want is map a string
12,12
to a float value12.12
. This comes before validation. So you need to configure the PropertyMapper. See comments in the\TYPO3\Flow\Property\TypeConverter\FloatConverter
which are pretty extensive.Roughly this is what you need:
For the additional question of accepting both formats
12,12
and12.12
as float12.12
you probably need to write your own FloatConverter that checks for the existence of a comma and does either of the two conversions.