# LocalizedToNormalized which replacement should I use?

**URL:** <https://discourse.laminas.dev/t/localizedtonormalized-which-replacement-should-i-use/3253>\
**Category:** Migration\
**Tags:** zf1, zend-filter\
**Created:** [March 23, 2023, 10:08am UTC](https://discourse.laminas.dev/t/localizedtonormalized-which-replacement-should-i-use/3253 "2023-03-23T10:08:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![seb\_dev](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@seb\_dev](https://discourse.laminas.dev/u/seb_dev)\
**Post date:** [March 23, 2023, 10:08am UTC](https://discourse.laminas.dev/t/localizedtonormalized-which-replacement-should-i-use/3253/1 "2023-03-23T10:08:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![froschdesign](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/froschdesign/32/38_2.png) [@froschdesign](https://discourse.laminas.dev/u/froschdesign)\
**Post date:** [March 23, 2023, 10:23am UTC](https://discourse.laminas.dev/t/localizedtonormalized-which-replacement-should-i-use/3253/2 "2023-03-23T10:23:45Z")

</div>

Hello and welcome to our forums! 😃

> [@seb\_dev](#):
>
> …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?

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

> **[Manual - Documentation - Zend Framework](https://framework.zend.com/manual/1.12/en/zend.filter.set.html#zend.filter.set.localizedtonormalized)**
>
> Zend Framework project official website

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

> **[Introduction - laminas-i18n - Laminas Docs](https://docs.laminas.dev/laminas-i18n/filters/introduction/)**
>
> Provide translations for your application, and filter and validate internationalized values.

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.

---

<div class="post-metadata">

**Author:** ![seb\_dev](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@seb\_dev](https://discourse.laminas.dev/u/seb_dev)\
**Post date:** [March 23, 2023, 10:28am UTC](https://discourse.laminas.dev/t/localizedtonormalized-which-replacement-should-i-use/3253/3 "2023-03-23T10:28:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![froschdesign](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/froschdesign/32/38_2.png) [@froschdesign](https://discourse.laminas.dev/u/froschdesign)\
**Post date:** [March 23, 2023, 10:53am UTC](https://discourse.laminas.dev/t/localizedtonormalized-which-replacement-should-i-use/3253/4 "2023-03-23T10:53:36Z")

</div>

More filters can be found in laminas-filter:

> **[laminas-filter - Laminas Docs](https://docs.laminas.dev/laminas-filter/)**
>
> Programmatically filter and normalize data and files.
