CBPCalc::functionNumberFormat

  1. Bitrix24 API (v. 23.675.0)
  2. bizproc
  3. CBPCalc
  4. functionNumberFormat
  • Модуль: bizproc
  • Путь к файлу: ~/bitrix/modules/bizproc/classes/general/calc.php
  • Класс: CBPCalc
  • Вызов: CBPCalc::functionNumberFormat
private function functionNumberFormat($args)
{
	$ar = $this->ArrgsToArray($args);
	$number = (float) array_shift($ar);
	$decimals = (int) (array_shift($ar) ?: 0);
	$decPoint = array_shift($ar);
	if ($decPoint === null)
	{
		$decPoint = '.';
	}
	$decPoint = (string) $decPoint;

	$thousandsSeparator = array_shift($ar);
	if ($thousandsSeparator === null)
	{
		$thousandsSeparator = ',';
	}
	$thousandsSeparator = (string) $thousandsSeparator;

	return number_format($number, $decimals, $decPoint, $thousandsSeparator);
}

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