In the symfony framework you can set scale value but that will cause symfony to round it for you after the scale. is there a way to trigger an exception if the length is > 5 for instance instead? Below code will only round the float to a scale of 5, and I'd like to know how throw an exception if it's more than 5 instead.
$builder
->add('amount', NumberType::class, [
'mapped' => false,
'required' => false,
'scale' => 5,
])