You are here

public function Price::multiply in Price 8

Same name and namespace in other branches
  1. 3.x src/Price.php \Drupal\price\Price::multiply()
  2. 2.0.x src/Price.php \Drupal\price\Price::multiply()
  3. 2.x src/Price.php \Drupal\price\Price::multiply()
  4. 3.0.x src/Price.php \Drupal\price\Price::multiply()

Multiplies the current price by the given number.

Parameters

string $number: The number.

Return value

static The resulting price.

File

src/Price.php, line 139

Class

Price
Provides a value object for monetary values.

Namespace

Drupal\price

Code

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