Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

402
Views
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 answers
Answer question

0

toLocaleString should be "en-US"

about 4 years ago · Juan Pablo Isaza Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!