magento / zf1

ZF1 adopted for Magento 2. Use composer in Magento 2 root to download it.
BSD 3-Clause "New" or "Revised" License
60 stars 61 forks source link

Fix toCurrency to correctly strip currency sign #32

Open mrbig opened 4 years ago

mrbig commented 4 years ago

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.