Neos\FluidAdaptor\ViewHelpers\Format\CurrencyViewHelper::render PHP Метод

render() публичный Метод

public render ( string $currencySign = '', string $decimalSeparator = ',', string $thousandsSeparator = '.' ) : string
$currencySign string (optional) The currency sign, eg $ or €.
$decimalSeparator string (optional) The separator for the decimal point.
$thousandsSeparator string (optional) The thousands separator.
Результат string the formatted amount.
    public function render($currencySign = '', $decimalSeparator = ',', $thousandsSeparator = '.')
    {
        $stringToFormat = $this->renderChildren();
        $useLocale = $this->getLocale();
        if ($useLocale !== null) {
            if ($currencySign === '') {
                throw new InvalidVariableException('Using the Locale requires a currencySign.', 1326378320);
            }
            try {
                $output = $this->numberFormatter->formatCurrencyNumber($stringToFormat, $useLocale, $currencySign);
            } catch (I18nException $exception) {
                throw new ViewHelperException($exception->getMessage(), 1382350428, $exception);
            }
        } else {
            $output = number_format((double) $stringToFormat, 2, $decimalSeparator, $thousandsSeparator);
            if ($currencySign !== '') {
                $output .= ' ' . $currencySign;
            }
        }
        return $output;
    }
CurrencyViewHelper