public function Price::isPositive in Commerce Core 8.2
Gets whether the current price is positive.
Return value
bool TRUE if the price is positive, FALSE otherwise.
File
- modules/
price/ src/ Price.php, line 193
Class
- Price
- Provides a value object for monetary values.
Namespace
Drupal\commerce_priceCode
public function isPositive() : bool {
return Calculator::compare($this->number, '0') == 1;
}