question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

EUR symbolOnLeft per country

See original GitHub issue

Very useful library, thanks for sharing!

So this is a major pain in the ass, and not specific to this library at all, but placement of the euro sign (€) differs between countries.

Quote from the European commission:

Where should the euro symbol be placed: ‘€ 100’ or ‘100 €’? There are no official standards on where to place the euro symbol. In English text, the usual practice is to place the symbol “€” before the amount in figures, i.e. € 100. In French text, the symbol is usually placed after the amount in figures, i.e. 100 €.

The app I’m working on requires correct placement across locales, so for example, our Dutch version should display €100, while the French version should display 100 €.

Currently we maintain our own list of currencies per country, which means that we have two “versions” of the euro, one with symbolOnLeft=true and the other one with symbolOnLeft=false. I can hardly imagine we’re the only ones struggling with this, and this library might be a nice central place to solve this issue.

Would love to hear your thoughts!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
smirzaeicommented, Feb 1, 2017

For some reason didn’t see the PR, I’ll check it out soon.

1reaction
edorivaicommented, Feb 1, 2017

I have a couple of suggestions!

First off, I checked the ECMAscript Intl api, which allows you to do this:

new Intl.NumberFormat('nl-NL', { style: 'currency', currency: 'EUR' }).format(1234.6789);
// '€ 1.234,68'
new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(1234.6789);
// '1.234,68 €'

Which looks awesome, and might be the ideal way to do it. Except that it turns out that not all browsers format all currencies the same for all locales. For example, I found that Firefox currently wrongly renders the euro sign before the amount for de-AT. And the Intl API does not support any way of overwriting the formatting.

Some of the reasons in favor of having a user-land package for currency rendering I can think of are:

  • Having predictable formatting across environments
  • Being able to override certain formats if this is required for your specific use-case
  • Having a shorter iteration cycle for fixing formats

If you’re open for it, I’ll start working on a locale-based implementation, and submit a PR.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Euro sign - Wikipedia
The euro sign (€) is the currency sign used for the euro, the official currency of the eurozone and unilaterally adopted by Kosovo...
Read more >
How to Format 30+ Currencies from Countries All Over the World
For example, countries in the European Union place the euro symbol to the right of the dollar amount. But to make things interesting,...
Read more >
Tutorial:Symbols and abbreviations - Statistics Explained
Expressing the full term 'euro' ; EN, FR, DE ; Use of euro in text, the euro,, l'euro,, der Euro, ; without figures,...
Read more >
Does the euro symbol go ahead of the number (€300 ... - Quora
The euro symbol generally goes ahead of the number. Most countries also as well, put their currency symbols ahead of the number.
Read more >
Does the Euro sign go before or after the number? - Reddit
It depends on which country you're in. Wikipedia has a nice table here. (I seem to recall seeing a it used as a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found