From 1f2a7b86e59f1cf92b8f04cc621994a57f86a043 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Fri, 17 Oct 2025 22:39:58 +0200 Subject: [PATCH] Fixed warning on PHP8.5 --- src/Services/Formatters/SIFormatter.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Services/Formatters/SIFormatter.php b/src/Services/Formatters/SIFormatter.php index a6325987..b83501fa 100644 --- a/src/Services/Formatters/SIFormatter.php +++ b/src/Services/Formatters/SIFormatter.php @@ -38,6 +38,11 @@ class SIFormatter */ public function getMagnitude(float $value): int { + //Check for zero, as log10(0) is undefined/gives -infinity, which leads to casting issues in PHP8.5+ + if (0.0 === $value) { + return 0; + } + return (int) floor(log10(abs($value))); }