src/Entity/FreightCharges.php
public function setMonetaryValue($var)
    {
        $this->monetaryValue = round($var, 2); // Max 2 decimals places

        if ($this->monetaryValue < 0) {
            throw new \Exception('Freight charges cannot be negative');
        }

        if (strlen((string)$this->monetaryValue) > 15) {
            throw new \Exception('Value too long');
        }

        return $this;
    }
public function setMonetaryValue($var)
    {
        $this->monetaryValue = round($var, 2); // Max 2 decimals places

        if ($this->monetaryValue < 0) {
            throw new \Exception('Freight charges cannot be negative');
        }

        if (strlen((string)$this->monetaryValue) > 15) {
            throw new \Exception('Value too long');
        }

        return $this;
    }
@param $var

@throws \Exception

@return $this