public function render($decimals = 2, $decimalSeparator = '.', $thousandsSeparator = ',', $localeFormatLength = NumbersReader::FORMAT_LENGTH_DEFAULT)
{
$stringToFormat = $this->renderChildren();
$useLocale = $this->getLocale();
if ($useLocale !== null) {
try {
$output = $this->numberFormatter->formatDecimalNumber($stringToFormat, $useLocale, $localeFormatLength);
} catch (I18nException $exception) {
throw new ViewHelperException($exception->getMessage(), 1382351148, $exception);
}
} else {
$output = number_format((double) $stringToFormat, $decimals, $decimalSeparator, $thousandsSeparator);
}
return $output;
}