You are here

public function Price::multiply in Commerce Core 8.2

Multiplies the current price by the given number.

Parameters

string $number: The number.

Return value

static The resulting price.

File

modules/price/src/Price.php, line 154

Class

Price
Provides a value object for monetary values.

Namespace

Drupal\commerce_price

Code

public function multiply(string $number) : Price {
  $new_number = Calculator::multiply($this->number, $number);
  return new static($new_number, $this->currencyCode);
}