How can I get the current number format (decimal separator, thousands seperator) according to the store-front's locale in a subscriber of the ProductListingCriteriaEvent
event in Shopware 6 ?
Goal is to parse strings to float which are given in the current locale (1.000,00 in DE and 1,000.00 in EN).
I looked at the event's context, but did not find the locale information.
I did the same logic in Twig before (which seems a bit crazy):
{% set thousands_separator = 1000.1|format_number(locale=app.locale)|replace({'0':'','1':''})|slice(-2,1) %}
{% set decimals_seperator = 1000.1|format_number(locale=app.locale)|replace({'0':'','1':''})|slice(-1,1) %}
{% set floatValue = stringValue | replace({thousands_separator:'', decimals_seperator:'.'}) %}
EDIT:
There is \Shopware\Core\Framework\App\AppLocaleProvider::getLocaleFromContext
but it provides only the locale code, not the number format information.