closure-library icon indicating copy to clipboard operation
closure-library copied to clipboard

Wrong placement of negative sign in currency for Norwegian locale

Open NorseJedi opened this issue 4 years ago • 7 comments

I originally reported this as an Angular bug pertaining to the currency pipe, and was told to report it here.

The locale for Norway places the negative sign in front of the symbol rather than in front of the digits.

Negative currency values will currently be formatted like this: −kr 1 000,00

The correct way to format them for Norwegian locale however, is this: kr −1 000,00

NorseJedi avatar Mar 10 '21 23:03 NorseJedi

As the file overview comment indicates, this might be the result of data missing from the CLDR dataset: https://github.com/google/closure-library/blob/39cb429b2e3c12170270b1e92ae2fbaeec007d75/closure/goog/i18n/numberformatsymbols.js#L9

I would guess the correct file to get updated would be https://github.com/unicode-org/cldr/blob/367b79b4a86a9cb12314158897d950268dc77b02/common/main/nb.xml#L11516 but I'd recommend filing a bug against the CLDR data first: http://cldr.unicode.org/index/bug-reports

12wrigja avatar Mar 11 '21 01:03 12wrigja

I filed https://unicode-org.atlassian.net/browse/CLDR-14591 to see if this can get fixed upstream.

12wrigja avatar Mar 12 '21 20:03 12wrigja

A quick update in case you weren't subscribed to that issue: it seems that this is fixed in CLDR 40. I'm not sure when that will land in Closure Library (that process is managed by a different team at Google).

12wrigja avatar Oct 08 '21 17:10 12wrigja

Hi If I'm allowed I want to add that Currency should fall behind the numbers: 20 NOK or 20 Kr, instead of in front, like how its handled for French. "¤ #,##0.00"

#1157

Akisan98 avatar Mar 07 '22 13:03 Akisan98

Hi If I'm allowed I want to add that Currency should fall behind the numbers: 20 NOK or 20 Kr, instead of in front, like how its handled for French. "¤ #,##0.00"

#1157

This is incorrect.

While both placements are allowed both for "NOK" and "kr", the most common placement for "NOK" is in front of the number. For "kr" it is usually placed after the number when it's part of a written sentence, while in lists and tables and such it can be either (although since MS Excel has always put it in front that's probably the most common placement).

Ref: Norwegian original: https://www.sprakradet.no/svardatabase/sporsmal-og-svar/kronebelop-rekkjefolgje-komma-og-strek/ English by Google Translate: https://www-sprakradet-no.translate.goog/svardatabase/sporsmal-og-svar/kronebelop-rekkjefolgje-komma-og-strek/?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp


EDIT: Noticed that the Google Translate version replaces all instances of "kr" with "NOK", so the text doesn't make much sense. Here's a proper translation:

Question: Should you write currency amounts with or without comma and dash, i.e. "kr 500,-" or "kr 500"? And should "kr" be in front or after the number? What about "NOK"?

Answer: All cases are actually correct, but write in in the easiest and most natural way, i.e. "500 kr", when there's no special reason to use other variations. "NOK" should be in front of the number, but is only used where it's important to specify the currency.

Note that a line is a dash, not a hyphen, and that comma and dash should never be used after an øre-amount. The dash represents "00 øre". After "kr" there should never be a period, except if it's at the end of a sentence of course.

When speaking, the most natural order is to have the number first. In regular text "500 kr" (or preferably "500 kroner") is the best option. In certain lineups it can be correct to turn it around.

If several currencies are involved, one should write "nkr" instead of "kr". The international currency code is "NOK", and it's common to put that in front of the number (without "kr" after).

There is no reason to use "nkr" or "NOK" if using "kr" is unambiguous in the context.

NorseJedi avatar Mar 07 '22 14:03 NorseJedi

So two Norwegian Devs don't see eye to eye, and I stand corrected; that's because both are valid, so NOK can come before or after amount.

Språkrådet (The Language Guild) - https://www.sprakradet.no/svardatabase/sporsmal-og-svar/kronebelop-rekkjefolgje-komma-og-strek/

  • The easiest and most natural way is 500 kr (After amount)
  • NOK ideally before amount (but can be flipped).
  • Normally 500 kr is the best, but in some cases it might be right to flip it.
  • If there is multiple currencies then nkr should be used. rather then kr (Considering that Danmark and Sweden also call their currency Kroner)

So both way should be possible to use in frameworks like Angular (and Flutter?), with Kr / NOK before or after amount as both are valid.

In Norwegian ",–" is often used to indicate price rather than kr.

If only one can be used then the Facts on Ground is that both Norges Bank and DNB uses Currency after amount.

Norges Bank (The Central Bank) - The institute responsible for monitary policies notes Currency after amount: https://www.norges-bank.no/tema/Statistikk/Valutakurser/?tab=currency&id=USD

DNB (The National Bank, where Gov. still has 34% share) https://www.dnb.no/markets/valuta-og-renter/valutakalkulator

Akisan98 avatar Mar 07 '22 23:03 Akisan98

This might be fixed: https://github.com/google/closure-library/blob/8889f54a9c15153c455d97d3847ad6e827370a6c/closure/goog/i18n/numberformatsymbols.js#L1973

Generally, all this feedback should be reported / debated over in a CLDR ticket, as Closure Library (and Flutter and many many other products) will simply use whatever is specified by CLDR: cldr.unicode.org/index/bug-reports. If the relevant pattern(s) are in CLDR and Closure Library isn't using them, that is definitely something we can address here.

If I'm understanding correctly, the Intl.NumberFormat APIs place kr in front of the currency:

new Intl.NumberFormat('nb', { style: 'currency', currency: 'NOK' }).format(-1000) //  kr -1.000,00"

12wrigja avatar Mar 07 '22 23:03 12wrigja