I have an application with a decimal field, for example:
/** * @var decimal $amount * * @ORM\Column(name="amount", type="decimal", scale="2") */ private $amount;
I want the form to accept numbers in the format "3.4" or "3.4".
If I enter “3.4”, the application saves in the database “3.4”, if I enter “3.4”, the application saves in the database “34” (yes, without a comma and without checking the validation error!).
(This is a known symfony bug: https://github.com/symfony/symfony/issues/2059 )
So, how can I accept numbers with commas as well as decimal points?
(I already tried to replace commas with a period in a DataTrasformer, but the DataTransformer accepts a number that is already normalized.)
source share