You are here

public function Price::isPositive in Price 2.0.x

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

Gets whether the current price is positive.

Return value

bool TRUE if the price is positive, FALSE otherwise.

File

src/Price.php, line 193

Class

Price
Provides a value object for monetary values.

Namespace

Drupal\price

Code

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