Skip to content

Firefly III: a personal finances manager

Fix https://github.com/firefly-iii/firefly-iii/issues/9078

James Colea0aef5d579c4
diff --git a/app/Support/Models/AccountBalanceCalculator.php b/app/Support/Models/AccountBalanceCalculator.php
index 3c17a3fc1e..192894a2e9 100644
--- a/app/Support/Models/AccountBalanceCalculator.php
+++ b/app/Support/Models/AccountBalanceCalculator.php
@@ -121,6 +121,10 @@ class AccountBalanceCalculator
$sumAmount = '' === $sumAmount ? '0' : $sumAmount;
$sumForeignAmount = '' === $sumForeignAmount ? '0' : $sumForeignAmount;
+ // at this point SQLite may return scientific notation because why not. Terrible.
+ $sumAmount = app('steam')->floatalize($sumAmount);
+ $sumForeignAmount = app('steam')->floatalize($sumForeignAmount);
+
// first create for normal currency:
$entry = $this->getAccountBalanceByAccount($account, $transactionCurrency);
diff --git a/app/Support/Steam.php b/app/Support/Steam.php
index 746668a2a0..3e13ed18de 100644
--- a/app/Support/Steam.php
+++ b/app/Support/Steam.php
@@ -836,6 +836,7 @@ class Steam
if (!str_contains($value, 'E')) {
return $value;
}
+ Log::debug(sprintf('Floatalizing %s', $value));
$number = substr($value, 0, (int)strpos($value, 'E'));
if (str_contains($number, '.')) {