You are here

public function Price::isNegative in Commerce Core 8.2

Gets whether the current price is negative.

Return value

bool TRUE if the price is negative, FALSE otherwise.

File

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

Class

Price
Provides a value object for monetary values.

Namespace

Drupal\commerce_price

Code

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