You are here

public function PriceModified::isZero in Price 3.x

Same name and namespace in other branches
  1. 8 src/PriceModified.php \Drupal\price\PriceModified::isZero()
  2. 3.0.x src/PriceModified.php \Drupal\price\PriceModified::isZero()

Gets whether the current price is zero.

Return value

bool TRUE if the price is zero, FALSE otherwise.

File

src/PriceModified.php, line 196

Class

PriceModified
Provides a value object for monetary values.

Namespace

Drupal\price

Code

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