CCrmCurrency::GetCurrencyFormatString

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmCurrency
  4. GetCurrencyFormatString
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_currency.php
  • Класс: \CCrmCurrency
  • Вызов: CCrmCurrency::GetCurrencyFormatString
static function GetCurrencyFormatString($currencyID, $langID = '')
{
	$currencyID = strval($currencyID);
	$langID = strval($langID);
	if($langID === '')
	{
		$langID = LANGUAGE_ID;
	}

	$formatStr = '';
	if(isset(self::$CURRENCY_FORMAT_BY_LANG[$langID]) && isset(self::$CURRENCY_FORMAT_BY_LANG[$langID][$currencyID]))
	{
		$formatStr = self::$CURRENCY_FORMAT_BY_LANG[$langID][$currencyID];
	}
	elseif(Loader::includeModule('currency'))
	{
		$formatInfo = CCurrencyLang::GetCurrencyFormat($currencyID, $langID);
		$formatStr = isset($formatInfo['FORMAT_STRING'])
			? $formatInfo['FORMAT_STRING'] : '#';

		if($formatStr !== '')
		{
			$formatStr = strip_tags($formatStr);
		}

		if($formatStr === '')
		{
			$formatStr = '#';
		}

		if(!isset(self::$CURRENCY_FORMAT_BY_LANG[$langID]))
		{
			self::$CURRENCY_FORMAT_BY_LANG[$langID] = array();
		}
		self::$CURRENCY_FORMAT_BY_LANG[$langID][$currencyID] = $formatStr;
	}

	return $formatStr;
}

Добавить комментарий