From b299afff5b42c008bb8bc0b15be3565d2d02f5ec Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 24 Jul 2023 09:20:04 +0200 Subject: [PATCH] Fix handling of negative numbers in StringUtil::formatInteger() The formatted value was compared against `0`, not the original integer. Just delegate to `formatNumeric()`. --- wcfsetup/install/files/lib/util/StringUtil.class.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/wcfsetup/install/files/lib/util/StringUtil.class.php b/wcfsetup/install/files/lib/util/StringUtil.class.php index 77017d16cd..ebc4d69264 100644 --- a/wcfsetup/install/files/lib/util/StringUtil.class.php +++ b/wcfsetup/install/files/lib/util/StringUtil.class.php @@ -176,13 +176,7 @@ final class StringUtil */ public static function formatInteger(int $integer): string { - $integer = self::getNumberFormatter()->format($integer); - - if ($integer < 0) { - return self::formatNegative($integer); - } - - return $integer; + return self::formatNumeric($integer); } /** -- 2.20.1