You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Negative currency amount is displayed as $-xxx,xxx.xx for en-us culture #10158
@petebacondarwin when "guessing" the negative pattern would it be more appropriate to use p.negPre = '-' + p.posPre;
instead of p.negPre = p.posPre + '-';
Thanks for the clarification, @clement911 and @petebacondarwin. I think in en-us '-' + p.posPre makes more sense.
Based on CLDR's documentation, displaying negative currency with a parenthesis around the number is a currency-accounting type. http://cldr.unicode.org/translation/number-patterns They changed the default display of a negative currency from a number in a parenthesis to prefixing it with a minus sign. A number in a parenthesis for negative currency is considered an accounting form based on this ticket: http://unicode.org/cldr/trac/ticket/5674
So for en-us, should we make negative currency to be displayed like -$123.45?
Activity
petebacondarwin commentedon Nov 21, 2014
I believe that this is because the en-us locale info in CLDR does not provide a specific negative pattern and so we "guess" at it on this line: https://github.com/angular/angular.js/blob/master/i18n/src/parser.js#L59
shwei commentedon Nov 22, 2014
@clement911 Using currency filter, the current display of negative US currency is wrapped around by parenthesis. e.g. ($1234.56) . Sample: http://plnkr.co/edit/w16eMG8LzJ1pe4iuPaum?p=preview
Don't know how you did it so I can reproduce it. Can you please provide a Plnkr? Thanks!
petebacondarwin commentedon Nov 23, 2014
@shwei - you need to load the en-US locale. See http://plnkr.co/edit/Gz9GcM1CarYuD4YRV5VB?p=preview
clement911 commentedon Nov 23, 2014
I'm pretty sure this line is where the regression is:
https://github.com/angular/angular.js/blob/master/src/ngLocale/angular-locale_en-us.js#L105
By the way, this issue affects other cultures too, for example en-au.
clement911 commentedon Nov 27, 2014
@petebacondarwin when "guessing" the negative pattern would it be more appropriate to use
p.negPre = '-' + p.posPre;instead of
p.negPre = p.posPre + '-';shwei commentedon Nov 30, 2014
Thanks for the clarification, @clement911 and @petebacondarwin. I think in en-us '-' + p.posPre makes more sense.
Based on CLDR's documentation, displaying negative currency with a parenthesis around the number is a currency-accounting type. http://cldr.unicode.org/translation/number-patterns They changed the default display of a negative currency from a number in a parenthesis to prefixing it with a minus sign. A number in a parenthesis for negative currency is considered an accounting form based on this ticket: http://unicode.org/cldr/trac/ticket/5674
So for en-us, should we make negative currency to be displayed like -$123.45?
fix(i18n): by default put negative sign before currency symbol
fix(i18n): by default put negative sign before currency symbol
fix(i18n): by default put negative sign before currency symbol
fix(i18n): by default put negative sign before currency symbol
fix(ng/$locale): by default put negative sign before currency symbol
fix(i18n): by default put negative sign before currency symbol
fix(ng/$locale): by default put negative sign before currency symbol
fix(i18n): by default put negative sign before currency symbol
fix(ng/$locale): by default put negative sign before currency symbol