@param float|null $price

@return $this
338367
public function setPromotionalPrice($price = null)
    {
        if (!is_null($price)) {
            $price = (float) $price;
        }
        
        $this->setData('promotional_price', $price);
        return $this;
    }
300347
public function setPrice($amount)
    {
        $tax    = $this->getTaxRate()  / 100;
        $taxAmount = $amount * $tax;

        $this->prices = [
            'pretax' => round($amount, 2),
            'tax'    => round($taxAmount, 2),
            'net'    => round($amount + $taxAmount, 2),
        ];

        return $this;
    }
577517
public function setPrice($price)
    {
        NumericValidator::validate($price, "Price");
        $price = Formatter::formatToPrice($price, $this->getCurrency());
        $this->price = $price;
        return $this;
    }
107594
public final function setX(float $x): self {
        $this->coordinates[self::X] = $this->gf
                ->getPrecisionModel()
                ->makePrecise($x);
        return $this;
    }
995081
public function setWeight($weight)
    {
        if ($weight !== NULL && !is_float($weight) && !is_int($weight)) {
            throw new InvalidArgumentException('Invalid weight given - must be numeric or NULL');
        }
        $this->weight = $weight;

        return $this;
    }
1269595
public function setLatitude($value)
    {
        if (is_float($value) || is_int($value) || (is_string($value) && is_numeric($value))) {
            $this->latitude = (float) $value;
        } else {
            $this->latitude = null;
        }

        return $this;
    }
741049
public function getPrice() : ?float 
    {
        if ( ! $this->hasPrice()) {
            $this->setPrice($this->getDefaultPrice());
        }
        return $this->price;
    }
1302865
public function setPrice($price)
    {
        if ($price instanceof Amount) {
            $price = $price->getNumber();
        }
        $this->price = $price;

        return $this;
    }
1172825
public function setRetailPrice(Money $retailPrice): self
    {
        $this->updateCurrency($retailPrice);
        $this->retailPrice = (int) $retailPrice->getAmount();
        $this->updateTotalRetailPrice();

        return $this;
    }
78317
public function price($price = null)
    {
        if (null === $price) {
            return $this->price;
        }

        $this->price = $price;

        return $this;
    }
813108
public function floatNone($size = null)
    {
        if (empty($size)) {
            $this->attributes->addAttributeClass('float-none');
        } elseif (in_array($size, ['xs', 'sm', 'md', 'lg', 'xl'])) {
            $this->attributes->addAttributeClass('float-' . $size . '-none');
        }

        return $this;
    }
921614
public function setPrice(Money $price): self
    {
        $this->updateCurrency($price);
        $this->price = (int) $price->getAmount();
        $this->updateTotalPrice();

        return $this;
    }
163393
public function setMax(?string $max) : self
    {
        if ($max !== null) {
            $max = Decimal::parse($max);
        }

        $this->max = $max;

        return $this;
    }
1283635
public function setValue($value, $data = null)
    {
        if (!$value) {
            $value = 0.00;
        }
        $this->value = DBCurrency::config()->uninherited('currency_symbol')
            . number_format((double)preg_replace('/[^0-9.\-]/', '', $value), 2);
        return $this;
    }
782101
public function float() {
        $this->check_role = 'float';
        $result = $this->filter($this->value, FILTER_VALIDATE_FLOAT);
        $this->checkResult($result);
        return $this;
    }
352922
public function setIfNotNull($key, $value)
    {
        if (is_null($value)) {
            return $this;
        }

        return $this->set($key, $value);
    }
726326
public function float($message = null)
    {
        $this->setRule(__FUNCTION__, function($val)
                       {
                           return !(filter_var($val, FILTER_VALIDATE_FLOAT) === FALSE);
                       }, $message);
        return $this;
    }