You are here

public function Price::isNegative in Price 2.0.x

Same name and namespace in other branches
  1. 2.x src/Price.php \Drupal\price\Price::isNegative()

Gets whether the current price is negative.

Return value

bool TRUE if the price is negative, FALSE otherwise.

File

src/Price.php, line 203

Class

Price
Provides a value object for monetary values.

Namespace

Drupal\price

Code

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