• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/config/ini.php
  • Класс: BitrixMainConfigIni
  • Вызов: Ini::unformatInt
static function unformatInt(string $str): int
{
	$str = strtolower($str);
	$res = intval($str);

	$suffix = substr($str, -1);
	if ($suffix == "k")
	{
		$res *= 1024;
	}
	elseif ($suffix == "m")
	{
		$res *= 1048576;
	}
	elseif ($suffix == "g")
	{
		$res *= 1048576*1024;
	}
	elseif ($suffix == "b")
	{
		$res = self::unformatInt(substr($str, 0, -1));
	}

	return $res;
}