From 8ef5fb5bc5e3c194ba0bf1c63f87fe19b0c48382 Mon Sep 17 00:00:00 2001 From: renky Date: Tue, 27 Nov 2018 16:34:36 +0100 Subject: [PATCH] Update MT940.php Problems with floatingpointprecission: If the amount is e.g. 9.36 then this floatval produces 9.359999999999999 what results in getAmount on Transaction giving this back. It should be kept as a string, and the user can decide wether he want's to use it as a float or not... --- lib/Fhp/Parser/MT940.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Fhp/Parser/MT940.php b/lib/Fhp/Parser/MT940.php index 568c1a7..5901e72 100755 --- a/lib/Fhp/Parser/MT940.php +++ b/lib/Fhp/Parser/MT940.php @@ -108,7 +108,7 @@ protected function parseToArray() $amount = $trxMatch[4]; $amount = str_replace(',', '.', $amount); - $trx[count($trx) - 1]['amount'] = floatval($amount); + $trx[count($trx) - 1]['amount'] = $amount; $description = $this->parseDescription($description); $trx[count($trx) - 1]['description'] = $description;