Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
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

Closed

Description

@clement911

Shouldn't a negative currency amount be displayed -$xxx,xxx.xx for en-us ?

With that commit it will show as $-xxx,xxx.xx which is kind of weird...

Activity

  1. petebacondarwin commented on Nov 21, 2014

    @petebacondarwin
    Contributor

    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

  2. added this to the milestone on Nov 21, 2014
  3. modified the milestones: , , ng-fixit #1 on Nov 22, 2014
  4. shwei commented on Nov 22, 2014

    @shwei
    Contributor

    @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!

  5. petebacondarwin commented on Nov 23, 2014

    @petebacondarwin
    Contributor

    @shwei - you need to load the en-US locale. See http://plnkr.co/edit/Gz9GcM1CarYuD4YRV5VB?p=preview

  6. clement911 commented on Nov 23, 2014

    @clement911
    Author

    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.

  7. clement911 commented on Nov 27, 2014

    @clement911
    Author

    @petebacondarwin when "guessing" the negative pattern would it be more appropriate to use
    p.negPre = '-' + p.posPre;
    instead of
    p.negPre = p.posPre + '-';

  8. shwei commented on Nov 30, 2014

    @shwei
    Contributor

    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?

  9. removed their assignment
    on Dec 16, 2014
  10. added 2 commits that reference this issue on Jul 16, 2015
    bbd4c4e
    97e9a63
  11. added 2 commits that reference this issue on Jul 16, 2015
    8fa8dde
    96f2e3b
  12. added a commit that references this issue on Jul 27, 2015
    5298672
  13. added 2 commits that reference this issue on Aug 8, 2015
    2b3e9db
    7526fe7
  14. added 2 commits that reference this issue on Sep 29, 2015
    76857fc
    8a4d090
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions