From f350948fb281ebe69bedc613a2f76acee452910d Mon Sep 17 00:00:00 2001 From: James Cole Date: Tue, 27 Dec 2022 17:17:00 +0100 Subject: [PATCH] Fix https://github.com/firefly-iii/firefly-iii/issues/6743 --- app/Support/Steam.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/Support/Steam.php b/app/Support/Steam.php index fd461da75d..e38787bfce 100644 --- a/app/Support/Steam.php +++ b/app/Support/Steam.php @@ -105,15 +105,18 @@ class Steam */ public function bcround(?string $number, int $precision = 0): string { + if(null === $number) { return '0'; } if('' === trim($number)) { return '0'; } + // if the number contains "E", it's in scientific notation, so we need to convert it to a normal number first. if(false !== stripos($number,'e')) { $number = sprintf('%.24f',$number); } + Log::debug(sprintf('Trying bcround("%s",%d)', $number, $precision)); if (str_contains($number, '.')) { if ($number[0] !== '-') {