-2

When I save a data in a easyadmin rendered form, value defined like float in swap into integer. Even if I put a float value in database, it is show as integer.

My entity:

/**
 * @var float
 *
 * @ORM\Column(name="cuantia", type="float", precision=8, scale=3, nullable=false)
 * @Assert\Range(min = 1, maxMessage = "La derrama debe ser mayor que 1€")
 */
private $cuantia;

EasyAdminCrud:

public function configureFields(string $pageName): iterable
    {
        return [
            NumberField::new('cuantia')
                ->addCssClass('eur')
                ->setFormTypeOption('scale', 8)
            ,

Value in database:

Value in explore

If I edit field and put a value, for example: 125.23 it save as 125 in database.

1 Answers1

0

It Solved!

I have to specify float in get method

public function getCuantia(): ?float