• Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/product/price/calculation.php
  • Класс: BitrixCatalogProductPriceCalculation
  • Вызов: Calculation::compare
static function compare($firstValue, $secondValue, $operator)
{
	$firstValue = static::roundPrecision($firstValue);
	$secondValue = static::roundPrecision($secondValue);

	$result = false;
	switch ($operator)
	{
		case '>':
			$result = ($firstValue > $secondValue);
			break;
		case '>=':
			$result = ($firstValue >= $secondValue);
			break;
		case '<':
			$result = ($firstValue < $secondValue);
			break;
		case '<=':
			$result = ($firstValue <= $secondValue);
			break;
		case '==':
			$result = ($firstValue == $secondValue);
			break;
		case '!=':
			$result = ($firstValue != $secondValue);
			break;
	}
	return $result;
}