• Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/product/price.php
  • Класс: BitrixCatalogProductPrice
  • Вызов: Price::roundValue
static function roundValue($value, $precision, $type)
{
	$type = (int)$type;
	if (!in_array($type, CatalogRoundingTable::getRoundTypes(false)))
		return $value;

	$precision = (float)$precision;
	if ($precision <= 0)
		return 0;
	if ($precision >= 1)
		$precision = (int)$precision;

	$value = (float)$value;
	if (abs($value) <= self::VALUE_EPS)
		return 0;

	return ($precision < 1
		? static::roundFraction($value, $precision, $type)
		: static::roundWhole($value, $precision, $type)
	);
}