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

Fix toCurrency to correctly strip currency sign #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mrbig
Copy link

@mrbig mrbig commented Jul 3, 2020

Zend_Currency::toCurrency has an option to return the currency formatted without the currency sign. It should also trim any whitespaces before or after the currency sign. However it did strip every whitespace from the formatted string, even if the given locale uses spaces to separate thousands groups. For example when using the Hungarian locale instead of 12 345 it did return 12345.

This can affect some plugins that depend on the zendframework, for example the Mageplaza_CurrencyFormatter.

This commit fixes this error, and adds some test around it.

Zend_Currency::toCurrency has an option to return the currency formatted
without the currency sign. It should also trim any whitespaces before
or after the currency sign. However it did strip every whitespace
from the formatted string, even if the given locale uses spaces to
separate thousands groups.

This commit fixes this error.

Signed-off-by: Nagy Attila Gabor <mrbig@sneaker.hu>
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

Successfully merging this pull request may close these issues.

None yet

1 participant