You are here

public function Price::divide in Price 8

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

Divides the current price by the given number.

Parameters

string $number: The number.

Return value

static The resulting price.

File

src/Price.php, line 153

Class

Price
Provides a value object for monetary values.

Namespace

Drupal\price

Code

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