You are here

public function PriceModified::divide in Price 3.x

Same name and namespace in other branches
  1. 8 src/PriceModified.php \Drupal\price\PriceModified::divide()
  2. 3.0.x src/PriceModified.php \Drupal\price\PriceModified::divide()

Divides the current price by the given number.

Parameters

string $number: The number.

Return value

static The resulting price.

File

src/PriceModified.php, line 171

Class

PriceModified
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, $this->modifier);
}