-
Notifications
You must be signed in to change notification settings - Fork 25.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currency Pipe Changes - US vs AU vs NZ Dollars #20385
Comments
I don't understand what the problem is, could you create a stackblitz (https://stackblitz.com/) showing the error please?
Is this not the behavior that you notice? |
Hey, sorry for being Confusing. Here: https://angular-xkimgk.stackblitz.io Problem is, locale isn't defining what "currency" symbol is being selected. In CurrencyPipe (https://github.com/angular/angular/blob/161f88fe6f8399a92ed7ab120f0d4ec647f7b139/packages/common/src/pipes/number_pipe.ts), the findCurrencySymbol method is being called without defining what locale and if you follow code goes to generated currency code list (https://github.com/angular/angular/blob/079d884b6cbe179c3565d8db443d76b1ae041af7/packages/common/src/i18n/currencies.ts), where USD is defined only as $. In previous version, by using the i18n libraries, if locale was en-AU, then australian (AUD) currency would be $10, and USD would be as USD$10, and vice versa if you swapped locale. I am not using symbol-short as I need to deal with all three currencies in the app,, so would be good if we aren't considering locale in particular that the currency symbol we use is consistent/not country bias. |
Ok I understand the problem and you're right, according to CLDR data AUD is $ in en-AU: https://github.com/unicode-cldr/cldr-numbers-modern/blob/master/main/en-AU/currencies.json#L124 We've extracted the currencies based on "en-US" locales only because it takes a lot of place to store currencies in all of the locales and we didn't even think about those kind of use cases. |
@ocombe: I'm a Googler and my team is also facing this issue. What are your plans and eta for dealing with this? I'm willing to contribute if you're out of bandwidth. |
We have a meeting to discuss this next Tuesday, it should not be very hard to resolve once we've agreed on the change. |
@ocombe Could you please describe what we discussed during our meeting ? IIRC we decided that: |
We will update the currency pipe to allow for custom symbol to be used so that you are not blocked until we figure out if we need to add those locale currency info, or if we open the i18n api so that an external library can provide this instead |
BREAKING CHANGE: we now use locale currency values to output the symbols, since they may be different in each locale (we were only using english data previously) Fixes angular#20385
we now use locale currency values to output the symbols, since they may be different in each locale (we were only using english data previously) Fixes angular#20385
we now use locale currency values to output the symbols, since they may be different in each locale (we were only using english data previously) Fixes angular#20385
we now use locale currency symbols, since they may be different in each locale (we were only using english data previously) Fixes angular#20385
we now use locale currency symbols, since they may be different in each locale (we were only using english data previously) Fixes angular#20385
we now use locale currency symbols, since they may be different in each locale (we were only using english data previously) Fixes angular#20385
we now use locale currency symbols, since they may be different in each locale (we were only using english data previously) Fixes angular#20385 PR Close angular#21783
we now use locale currency symbols, since they may be different in each locale (we were only using english data previously) Fixes angular#20385 PR Close angular#21783
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I'm submitting a...
Current behavior
In the latest release, changes from using the i18n API to internal has stopped utilising locale for when displaying currency:
So
Expected behavior
I would expect consistent behaviour or to utilise locale to display currency. If locale wasn't utilised I would expect
The app I am working on handles all three currencies (NZD, AUD, & USD), and it utilised by people who travel so US customers to AUD products and vice versa are common, so clarity on currency is important.
What is the motivation / use case for changing the behavior?
The app I am working on handles all three currencies (NZD, AUD, & USD), and it utilised by people who travel so US customers to AUD products and vice versa are common, so clarity on currency is important.
People book a wine tour from US for their visit to Australia, the people in the admin staff manage the tours through central app which has all NZ, US, & AU tours, etc.
Environment
The text was updated successfully, but these errors were encountered: