Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

404
Vistas
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 Respuestas
Responde la pregunta

0

toLocaleString should be "en-US"

about 4 years ago · Juan Pablo Isaza Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda