public function asInteger($value, $options = [], $textOptions = [])
{
if ($value === null) {
return $this->nullDisplay;
}
$value = $this->normalizeNumericValue($value);
if ($this->_intlLoaded) {
$f = $this->createNumberFormatter(NumberFormatter::DECIMAL, null, $options, $textOptions);
$f->setAttribute(NumberFormatter::FRACTION_DIGITS, 0);
if (($result = $f->format($value, NumberFormatter::TYPE_INT64)) === false) {
throw new InvalidParamException('Formatting integer value failed: ' . $f->getErrorCode() . ' ' . $f->getErrorMessage());
}
return $result;
} else {
return number_format((int) $value, 0, $this->decimalSeparator, $this->thousandSeparator);
}
}