From 7b2c3861e09f60df5f72c50ab283a8fbf5981777 Mon Sep 17 00:00:00 2001 From: Aaron Saderholm Date: Sat, 10 Dec 2016 14:02:12 -0500 Subject: [PATCH] Not correctly handling negative numbers larger than a couple of digits. --- lib/OfxParser/Ofx.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/OfxParser/Ofx.php b/lib/OfxParser/Ofx.php index c3d0b6e..dac8acd 100644 --- a/lib/OfxParser/Ofx.php +++ b/lib/OfxParser/Ofx.php @@ -311,11 +311,7 @@ private function createAmountFromStr($amountString) { // Decimal mark style (UK/US): 000.00 or 0,000.00 if (preg_match('/^-?([\d,]+)(\.?)([\d]{2})$/', $amountString) === 1) { - return (float)preg_replace( - ['/([,]+)/', '/\.?([\d]{2})$/'], - ['', '.$1'], - $amountString - ); + return floatval($amountString); } // European style: 000,00 or 0.000,00