Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$ not supported by stringToUnits() #98

Closed
thedavidmeister opened this issue May 24, 2015 · 7 comments
Closed

$ not supported by stringToUnits() #98

thedavidmeister opened this issue May 24, 2015 · 7 comments

Comments

@thedavidmeister
Copy link

I tried to get '$100' to be some Money units using stringToUnits() but got "The value could not be parsed as money".

@thedavidmeister
Copy link
Author

$string = preg_replace('@\p{Sc}*@', '', $string);

@thedavidmeister
Copy link
Author

#101

@frederikbosch
Copy link
Member

Regardless the fact that #101 has been merged, it might be an idea to also create a MoneyParser interface with a IntlMoneyParser implementation. By using ext/intl the support for different notations will be - I guess - much larger.

@sagikazarmark What do you think?

@frederikbosch
Copy link
Member

The current stringToUnit method might become StringToUnitParser class. The current static method will call the StringToUnit->parse method and needs to be deprecated.

@frederikbosch
Copy link
Member

Should be fixed in #148.

sagikazarmark added a commit that referenced this issue Jan 30, 2016
Parse a string into a money object, fixes #98
@sagikazarmark
Copy link
Collaborator

Fixed in #148

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants