LocalizedToNormalized which replacement should I use?

Hi there,

in some of our plugins in Magento, they use Zend_Filter_LocalizedToNormalized, what do I need to change this into to make use of Laminas? Thanks.

Best regards,
Seb

Hello and welcome to our forums! :smiley:

It depends on the data to be filtered because the old filters supports different types of data:

The following input types can be normalized and localized:

  • integer: Integer numbers. Normalization returns the english notation
  • float: Float numbers. Normalization returns the english notation
  • numbers: Other numbers, like real. Normalization returns the english notation
  • time: Time values. The normalized value is a named array
  • date: Date values. The normalized value is a named array

Please check the laminas-i18n documentation for the appropriate filters:

If you work with date values, you must look for another library. The base for the old filters Zend_Locale was never ported because it was a monster, outdated and had too many bugs.

1 Like

Hi froschdesign,

thanks for your reply. In this case it is used for add to cart action, specifically the qty. Thanks for pointing me in the right direction. I needed to use Laminas\I18n\Filter\NumberFormat.

Best regards,
Seb

More filters can be found in laminas-filter: