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:
commit
2329dcf790
1 changed files with 1 additions and 1 deletions
|
|
@ -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.');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue