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.

Currency placement

See original GitHub issue

It doesn’t look like the language files take into account currency symbol placement. In much of the Eurozone, the Euro symbol is placed on the right. I’m using the French language file, and this is the result:

numeral("100").format('$0,0.00')
--> "€100,00"
numeral("10000").format('$0,0.00')
--> "€10 000,00"

It should be 100,00 €

See http://userguide.icu-project.org/formatparse for examples of what is expected

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Reactions:1
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

8reactions
samdjstevenscommented, Sep 13, 2017

@adamwdraper Are you open to an extra setting for this in the currency object in locales?

Would be really useful for multi language apps to make setting the right position of the currency symbol configurable in locales rather than implementing custom logic based on the user locale.

2reactions
sesamcommented, Dec 13, 2019

fixed

Where and how is this handled? In the master branch, I only find

                    before: format.match(/^([\+|\-|\(|\s|\$]*)/)[0],
                    after: format.match(/([\+|\-|\)|\s|\$]*)$/)[0]

which can not correctly handle the case where € is either in front or behind depending on country and language settings.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Currency formatting - Globalization - Microsoft Learn
Currency symbol placement — It can be either place before or after the digits. Negative-amounts — Several of the ways to display negative ......
Read more >
Currency symbol - Wikipedia
A currency symbol or currency sign is a graphic symbol used to denote a currency unit. ... 50, for example; this positioning is...
Read more >
Working with currency, number and date formats
The exact usage and placement of these symbols varies by locale. Consideration should be given to whether the customary symbols are clear and...
Read more >
International Currency Conversion - DFA Cornell
For these reasons, it's critically important to recognize the differences in the placement of decimal points and commas in international currency.
Read more >
Currency-symbol formatting - HCL Informix documentation
When you group several dollar signs in a row, a single currency symbol floats to the rightmost position that it can occupy without...
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