public function Price::divide in Commerce Core 8.2
Divides 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 168
Class
- Price
- Provides a value object for monetary values.
Namespace
Drupal\commerce_priceCode
public function divide(string $number) : Price {
$new_number = Calculator::divide($this->number, $number);
return new static($new_number, $this->currencyCode);
}