-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Description
I have a form with a ChoiceType like this:
$builder
->add('vatRate', ChoiceType::class, [
'expanded' => true,
'choices' => [
'0%' => 0.0,
'6%' => 0.06,
'21%' => 0.21,
],
'choices_as_values' => true
]);
My object passed to the form has 0.0 (float) as initial value, but the first item of the radio buttons does not get selected/checked. I tried several configurations but nothing seems to work.
Is this a bug with the formbuilder not being able to handle floats correctly?
I am on symfony 2.8.13