EasyAdmin 3 Can't diffuse decimal with numberfield

567 views Asked by At

I'm working with symfony5 and easyadmin3. There is no error displayed. Here is the trouble :

I got a method get() in my entity

'''
    /**
    * @ORM\Column(type="integer")
     */
    private $montageCharge;
////
  public function getMontageCharge(): ?int
    {
      var_dump((($this->montageCharge)/100));
        return (($this->montageCharge)/100);
    }
public function setWorkCharge(int $workCharge): self
    {
        $this->workCharge = $workCharge;

        return $this;
    }
'''

Which i'm using to get numbers with coma. The dump confirm it with a number with coma and a float format :

Product.php:159:int 4
Product.php:159:float 0.7

However, i didnt manage to see it in my crud controller, where they only appear as a rounded number, no coma. here is the configureField in my controller :

'''
NumberField::new('Work_Charge'),
''' 

The crudcontroller is showing 1 instead of 0.7. So my question is : how can i manage to diffuse correct number with coma, using easyadmin3 crudcontroller?

I tried a lot of other field so far, no one made it.

0

There are 0 answers