private function formatSizeNumber($value, $decimals, $options, $textOptions)
{
$value = $this->normalizeNumericValue($value);
$position = 0;
do {
if (abs($value) < $this->sizeFormatBase) {
break;
}
$value /= $this->sizeFormatBase;
$position++;
} while ($position < 5);
// no decimals for bytes
if ($position === 0) {
$decimals = 0;
} elseif ($decimals !== null) {
$value = round($value, $decimals);
}
// disable grouping for edge cases like 1023 to get 1023 B instead of 1,023 B
$oldThousandSeparator = $this->thousandSeparator;
$this->thousandSeparator = '';
if ($this->_intlLoaded) {
$options[NumberFormatter::GROUPING_USED] = false;
}
// format the size value
$params = ['n' => abs($value), 'nFormatted' => $this->asDecimal($value, $decimals, $options, $textOptions)];
$this->thousandSeparator = $oldThousandSeparator;
return [$params, $position];
}