From f19571b20e32d4293fbae6445551d642236f758c Mon Sep 17 00:00:00 2001 From: marscoo Date: Wed, 24 Aug 2022 12:07:34 +0800 Subject: [PATCH] Fix deprecated implicit conversion on PHP 8.1 Deprecated: Implicit conversion from float -INF to int loses precision in /app/vendor/stillat/numeral.php/src/Numeral.php on line 720 --- src/Numeral.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Numeral.php b/src/Numeral.php index b7f78bec..3c17b123 100644 --- a/src/Numeral.php +++ b/src/Numeral.php @@ -717,7 +717,7 @@ public function formatNumber($number, $format, $sep = '') $totalLength = floor(log($abs) / log(10)) + 1; - $minimumPrecision = $totalLength % 3; + $minimumPrecision = (int)$totalLength % 3; $minimumPrecision = ($minimumPrecision === 0) ? 3 : $minimumPrecision; if ($intPrecision > 0 && $abs !== 0) {