diff --git a/Sources/Lang.php b/Sources/Lang.php index 5585c4e9937..20b3c292833 100644 --- a/Sources/Lang.php +++ b/Sources/Lang.php @@ -948,14 +948,7 @@ public static function numberFormat(int|float|string $number, ?int $decimals = n } } - $skeleton = match (true) { - // Told to use a specific number of decimal places. - !empty($decimals) => ':: .' . str_repeat('0', $decimals), - // Integers are easy. - ctype_digit((string) $number) => 'integer', - // Floats default to as much precision as necessary. - default => ':: .0*', - }; + $skeleton = ':: ' . (!isset($decimals) ? '.*' : 'precision-increment/' . (10 ** -$decimals)) . ' rounding-mode-half-up'; return MessageFormatter::formatMessage('{0, number, ' . $skeleton . '}', [$number]); }