Using locale en
Validation Demo
By default, it uses system locale (en), you can also switch to any other one:
We use the following validation rule to assert 2 decimal digits:
->decimal('balance', 2);
And we do need to activate locale parsing on the decimal type:
TypeFactory::build('decimal')->useLocaleParser();
Note:
- The input on purpose has been made text input instead of number input to showcase validation better (also non numeric characters possible).
- The form has novalidate true set to make sure it can always be posted, even if not yet valid.