1
0
Fork 0
mirror of https://github.com/archtechx/money.git synced 2025-12-12 11:24:03 +00:00

Merge branch 'from_string_implementation' of github.com:gauravmak/money into from_string_implementation

This commit is contained in:
Gaurav 2022-03-09 13:06:45 +05:30
commit 2329dcf790

View file

@ -33,7 +33,7 @@ class PriceFormatter
$formatted = ltrim($formatted, $currency->prefix());
$formatted = rtrim($formatted, $currency->suffix());
$removeNonDigits = preg_replace('/[^\d'.preg_quote($currency->decimalSeparator()).']/', '', $formatted);
$removeNonDigits = preg_replace('/[^\d' . preg_quote($currency->decimalSeparator()) . ']/', '', $formatted);
if (!is_string($removeNonDigits)) {
throw new \Exception('The formatted string could not be resolved to a valid number.');