ensure integer is formatted without fraction digits

fixes #5179
This commit is contained in:
Carsten Brandt
2014-10-03 19:39:04 +02:00
parent df9a0f08fc
commit dfc4de877f
2 changed files with 45 additions and 2 deletions

View File

@@ -727,6 +727,7 @@ class Formatter extends Component
$value = $this->normalizeNumericValue($value);
if ($this->_intlLoaded) {
$f = $this->createNumberFormatter(NumberFormatter::DECIMAL, null, $options, $textOptions);
$f->setAttribute(NumberFormatter::FRACTION_DIGITS, 0);
return $f->format($value, NumberFormatter::TYPE_INT64);
} else {
return number_format((int) $value, 0, $this->decimalSeparator, $this->thousandSeparator);