Skip to content

Set number format for different locale than current #1996

@MickL

Description

@MickL

Clear and concise description of the problem

I have a shop that sells to EU countries. All of the EU countries use the same number format: 1.150,00 €

My main website is in German (locale: de), but I want to add an english translation (locale: en) for all other countries. By doing that, the number format now changes to €1,150.00 which is a number format no one would ever use.

How can I set the the format to be e.g. german for the english locale?

My current config:

const numberFormats = {
  currency: {
    style: 'currency',
    currency: 'EUR',
  },
};

export default defineI18nConfig(() => ({
  numberFormats: {
    de: numberFormats,
    en: numberFormats,
  },
);

I assume that this will create new Intl.NumberFormat('de', numberFormats); and new Intl.NumberFormat('en', numberFormats); but the en one I want to replace with also 'de'.

Suggested solution

Alternative

No response

Additional context

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions