Skip to content

Commit

Permalink
remove symbol while parsing amount
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdulici committed Sep 1, 2018
1 parent 201967d commit d56221b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Money.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d56221b

Please sign in to comment.