From 7e590fb6b3421ce777018dca85e15df08d40d277 Mon Sep 17 00:00:00 2001 From: Ben Date: Wed, 3 Oct 2018 14:10:53 +0200 Subject: [PATCH] Use arbitrary precision math --- app/Support/Import/Routine/FinTS/StageImportDataHandler.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Support/Import/Routine/FinTS/StageImportDataHandler.php b/app/Support/Import/Routine/FinTS/StageImportDataHandler.php index 1f120c5600..e22927ffce 100644 --- a/app/Support/Import/Routine/FinTS/StageImportDataHandler.php +++ b/app/Support/Import/Routine/FinTS/StageImportDataHandler.php @@ -71,7 +71,7 @@ class StageImportDataHandler { Log::debug(sprintf('Start converting transaction %s', $transaction->getDescription1())); - $amount = $transaction->getAmount(); + $amount = (string) $transaction->getAmount(); $debitOrCredit = $transaction->getCreditDebit(); Log::debug(sprintf('Amount is %s', $amount)); @@ -79,7 +79,7 @@ class StageImportDataHandler $type = TransactionType::DEPOSIT; } else { $type = TransactionType::WITHDRAWAL; - $amount = -$amount; + $amount = bcmul($amount, '-1'); } $destination = $this->mapper->map(