Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

408
Visualizações
How to format prices in JS

I'm using currencyFormatter for my prices, and I would like to present my prices with the euro sign after the price and a full stop instead of a comma

Ej. 10.000€ (10 thousand euro).

(10000).toLocaleString(xxxx, {
  style: 'currency',
  currency: 'USD',
});

Does anyone know which unit I should use in the xxxx? Thanks for your help!

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

toLocaleString should be "en-US"

about 4 years ago · Juan Pablo Isaza Relatório

0

I'd suggest playing around with the locales a bit, or just leave it as undefined to use the user's locale. It appears that 'de-DE' (Germany) appears fairly close to your desired format.

As for the euro sign, you need to have currency: 'EUR' for that.

console.log((10000).toLocaleString('de-DE', {
  style: 'currency',
  currency: 'EUR',
  maximumFractionDigits: 0
}));

number#toLocaleString uses the arguments from Intl.NumberFormat which I'd suggest reading through.

In this case, I used maximumFractionDigits to remove the values after the decimal point.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda