src/MvcCore/Ext/Views/Helpers/FormatMoneyHelper.php
protected function formatByIntlMoneyFormatter ($valueToFormat = 0.0, $decimalsCount = NULL, $currency = NULL) {
		$formatter = $this->getIntlNumberFormatter(
			$this->langAndLocale,
			\NumberFormatter::CURRENCY,
			NULL,
			($decimalsCount !== NULL
				? [\NumberFormatter::FRACTION_DIGITS => $decimalsCount]
				: [])
		);
		if ($currency === NULL) {
			if ($this->defaultCurrency !== NULL) {
				// try to get default currency
				$currency = $this->defaultCurrency;
			} else {
				// try to get currency from localized formatter
				$currency = \numfmt_get_symbol($formatter, \NumberFormatter::INTL_CURRENCY_SYMBOL);
				if (mb_strlen($currency) !== 3) {
					// try to get currency by system locale settings, by formatting conventions
					if ($this->encodingConversion === NULL) {
						$this->setUpSystemLocaleAndEncodings();
						$this->setUpLocaleConventions();
					}
					$currency = $this->localeConventions->int_curr_symbol;
				}
			}
		}
		return \numfmt_format_currency($formatter, $valueToFormat, $currency);
	}
protected function formatByIntlMoneyFormatter ($valueToFormat = 0.0, $decimalsCount = NULL, $currency = NULL) {
		$formatter = $this->getIntlNumberFormatter(
			$this->langAndLocale,
			\NumberFormatter::CURRENCY,
			NULL,
			($decimalsCount !== NULL
				? [\NumberFormatter::FRACTION_DIGITS => $decimalsCount]
				: [])
		);
		if ($currency === NULL) {
			if ($this->defaultCurrency !== NULL) {
				// try to get default currency
				$currency = $this->defaultCurrency;
			} else {
				// try to get currency from localized formatter
				$currency = \numfmt_get_symbol($formatter, \NumberFormatter::INTL_CURRENCY_SYMBOL);
				if (mb_strlen($currency) !== 3) {
					// try to get currency by system locale settings, by formatting conventions
					if ($this->encodingConversion === NULL) {
						$this->setUpSystemLocaleAndEncodings();
						$this->setUpLocaleConventions();
					}
					$currency = $this->localeConventions->int_curr_symbol;
				}
			}
		}
		return \numfmt_format_currency($formatter, $valueToFormat, $currency);
	}
protected function formatByIntlMoneyFormatter ( $ valueToFormat = 0.0 , $ decimalsCount = NULL , $ currency = NULL ) { $ formatter = $ this -> getIntlNumberFormatter ( $ this -> langAndLocale , \ NumberFormatter :: CURRENCY , NULL , ( $ decimalsCount !== NULL ? [ \ NumberFormatter :: FRACTION_DIGITS => $ decimalsCount ] : [ ] ) ) ; if ( $ currency === NULL ) { if ( $ this -> defaultCurrency !== NULL ) { // try to get default currency $ currency = $ this -> defaultCurrency ; } else { // try to get currency from localized formatter $ currency = \ numfmt_get_symbol ( $ formatter , \ NumberFormatter :: INTL_CURRENCY_SYMBOL ) ; if ( mb_strlen ( $ currency ) !== 3 ) { // try to get currency by system locale settings, by formatting conventions if ( $ this -> encodingConversion === NULL ) { $ this -> setUpSystemLocaleAndEncodings ( ) ; $ this -> setUpLocaleConventions ( ) ; } $ currency = $ this -> localeConventions -> int_curr_symbol ; } } } return \ numfmt_format_currency ( $ formatter , $ valueToFormat , $ currency ) ; }
Format money by `Intl` extension formatter. If no international three chars currency
symbol is provided, there is used currency symbol from localized `Intl` formatter instance.
@see http://php.net/manual/en/numberformatter.create.php
@see http://php.net/manual/en/numberformatter.formatcurrency.php
@param int|float		$valueToFormat	Numeric value to format.
@param int|NULL		$decimalsCount	Optional, numerics count after decimal point,
If `NULL`, there is used `Intl` localized formatter
default value for money, usually two - `2`.
@param string|NULL	$currency		Optional, 3-letter ISO 4217 currency code
indicating the currency to use.
@return string
Format money by Intl extension formatter . If no international three chars currency symbol is provided there is used currency symbol from localized Intl formatter instance .