public function asScientific($value, $decimals = null, $options = [], $textOptions = [])
{
if ($value === null) {
return $this->nullDisplay;
}
$value = $this->normalizeNumericValue($value);
if ($this->_intlLoaded) {
$f = $this->createNumberFormatter(NumberFormatter::SCIENTIFIC, $decimals, $options, $textOptions);
if (($result = $f->format($value)) === false) {
throw new InvalidParamException('Formatting scientific number value failed: ' . $f->getErrorCode() . ' ' . $f->getErrorMessage());
}
return $result;
} else {
if ($decimals !== null) {
return sprintf("%.{$decimals}E", $value);
} else {
return sprintf('%.E', $value);
}
}
}