public function Price::divide in Price 3.0.x
Same name and namespace in other branches
- 8 src/Price.php \Drupal\price\Price::divide()
- 3.x src/Price.php \Drupal\price\Price::divide()
- 2.0.x src/Price.php \Drupal\price\Price::divide()
- 2.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\priceCode
public function divide($number) {
$new_number = Calculator::divide($this->number, $number);
return new static($new_number, $this->currencyCode);
}