You are here

public function Price::isZero in Commerce Core 8.2

Gets whether the current price is zero.

Return value

bool TRUE if the price is zero, FALSE otherwise.

File

modules/price/src/Price.php, line 213

Class

Price
Provides a value object for monetary values.

Namespace

Drupal\commerce_price

Code

public function isZero() : bool {
  return Calculator::compare($this->number, '0') == 0;
}