• Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/model/entity.php
  • Класс: BitrixCatalogModelEntity
  • Вызов: Entity::prepareFloatValue
static function prepareFloatValue($value): ?float
{
	if ($value === null)
	{
		return null;
	}

	$result = null;
	if (is_string($value))
	{
		if ($value !== '' && is_numeric($value))
		{
			$value = (float)$value;
			if (is_finite($value))
			{
				$result = $value;
			}
		}
	}
	else
	{
		if (is_int($value))
		{
			$value = (float)$value;
		}
		if (
			is_float($value) && is_finite($value)
		)
		{
			$result = $value;
		}
	}

	return $result;
}