I have an entity that has three fields of decimal type
/**
* @var decimal
*
* @ORM\Column(name="cantidad", type="decimal", precision = 3, scale=2)
*/
private $cantidad;
/**
* @var decimal
*
* @ORM\Column(name="precio_cuc", type="decimal",precision = 3, scale=2)
*/
private $precio_cuc;
/**
* @var decimal
*
* @ORM\Column(name="precio_cup", type="decimal",precision = 3 ,scale=2)
*/
private $precio_cup;
In my Form that the entity manages, I have it declared like this .. I only put one ..the others are equal
->add('cantidad',NumberType::class,array(
'scale' => 2,
))
but at the time of saving the entity in the BD the field approaches an integer .. if I enter 4.5 it approaches it to 5.. In the BD the fields are declared as decimal too ..
What is the error that I do not see?