You are here

public function Price::isZero in Price 8

Same name and namespace in other branches
  1. 3.x src/Price.php \Drupal\price\Price::isZero()
  2. 2.0.x src/Price.php \Drupal\price\Price::isZero()
  3. 2.x src/Price.php \Drupal\price\Price::isZero()
  4. 3.0.x src/Price.php \Drupal\price\Price::isZero()

Gets whether the current price is zero.

Return value

bool TRUE if the price is zero, FALSE otherwise.

File

src/Price.php, line 178

Class

Price
Provides a value object for monetary values.

Namespace

Drupal\price

Code

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