EUR symbolOnLeft per country
See original GitHub issueVery 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:
- Created 7 years ago
- Comments:7 (4 by maintainers)
Top GitHub Comments
For some reason didn’t see the PR, I’ll check it out soon.
I have a couple of suggestions!
First off, I checked the ECMAscript Intl api, which allows you to do this:
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:
If you’re open for it, I’ll start working on a locale-based implementation, and submit a PR.