CCrmCurrency::GetCurrencyFormatParams

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmCurrency
  4. GetCurrencyFormatParams
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_currency.php
  • Класс: \CCrmCurrency
  • Вызов: CCrmCurrency::GetCurrencyFormatParams
static function GetCurrencyFormatParams($currencyID)
{
	if(!Loader::includeModule('currency'))
	{
		return array();
	}

	$result = CCurrencyLang::GetFormatDescription($currencyID);
	// TODO: remove after currency stable
	if (!isset($result['TEMPLATE']))
	{
		$result['TEMPLATE'] = [
			'SINGLE' => $result['FORMAT_STRING'],
			'PARTS' => [
				0 => '#'
			],
			'VALUE_INDEX' => 0
		];
		$parts = CCurrencyLang::getParsedCurrencyFormat($currencyID);
		if (!empty($parts))
		{
			$result['TEMPLATE']['PARTS'] = $parts;
			$result['TEMPLATE']['VALUE_INDEX'] = (int)array_search('#', $parts);
		}
		unset($parts);
	}

	return $result;
}

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