From d56221b2cbf4771c50da0c2e0273869cc659ed2e Mon Sep 17 00:00:00 2001 From: denisdulici Date: Sat, 1 Sep 2018 14:56:07 +0300 Subject: [PATCH] remove symbol while parsing amount --- src/Money.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Money.php b/src/Money.php index c99b878..a3bae3d 100644 --- a/src/Money.php +++ b/src/Money.php @@ -274,6 +274,7 @@ protected function parseAmountFromString($amount) $thousandsSeparator = $this->currency->getThousandsSeparator(); $decimalMark = $this->currency->getDecimalMark(); + $amount = str_replace($this->currency->getSymbol(), '', $amount); $amount = preg_replace('/[^0-9\\' . $thousandsSeparator . '\\' . $decimalMark . '\-\+]/', '', $amount); $amount = str_replace($this->currency->getThousandsSeparator(), '', $amount); $amount = str_replace($this->currency->getDecimalMark(), '.', $amount);