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 }}
Repository navigation
Perhaps incorrect formatting when using currency pipe with locale de-AT #24609
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
[ ] Other... Please describe:
Current behavior
The currency pipe uses the wrong decimal symbol when called with the locale 'de-AT'.
This does not occur with the decimal pipe, it uses the correct decimal symbol.
Input: 123456789
Current output from currency pipe with locale 'de-AT': € 123 456 789.00
Expected output from currency pipe with locale 'de-AT': € 123 456 789,00
What is the motivation / use case for changing the behavior?
Environment
Angular version: 6.0.5
Browser:
- [x] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
For Tooling issues:
- Node version: XX
- Platform:
Others:
* | . | Replaced automatically by the character used for the decimal point. |
now the character used for decimal point is only defined once, the first symbol in the numbers line above, which is a ,.
Am I wrong about something here?
is the digit grouping symbol used for currencies if it is defined?
And if undefined it will fallback to the 2nd symbol of this line, the digit grouping symbol for decimals.
E.g. in the locales/de.ts file this last symbol is undefined, which means same symbol for decimals as for currencies?
Activity
cat-mandres commentedon Jun 22, 2018
Can this somehow be read from the locale files in the angular repo, e.g. here?
https://github.com/angular/angular/blob/master/packages/common/locales/de-AT.ts
https://github.com/angular/angular/blob/master/packages/common/locales/de.ts
I cant really find the difference in here where the other symbol is defined.
cat-mandres commentedon Jun 22, 2018
Yes I know that - and if you now take the lines from the de-AT.ts file
angular/packages/common/locales/de-AT.ts
Line 54 in 637805a
and
angular/packages/common/locales/de-AT.ts
Line 55 in 637805a
You get the following format for currencies get formatted:
¤ #,##0.00According to this method which is getting used by the currency pipe to get the number:
angular/packages/common/src/i18n/locale_data_api.ts
Line 365 in 637805a
the dot should get replaced by the character used for decimal point.
angular/packages/common/src/i18n/locale_data_api.ts
Line 351 in 637805a
now the character used for decimal point is only defined once, the first symbol in the numbers line above, which is a
,.Am I wrong about something here?
trotyl commentedon Jun 25, 2018
The bug is caused by the following code:
angular/tools/gulp-tasks/cldr/extract.js
Lines 447 to 453 in ce40e85
There should be an
elseclause forcurrencyDecimalto push anundefinedvalue to hold this position, like:Otherwise
currencyDecimalandcurrencyGroupwould be mixed up.I guess a PR would be welcomed.
Also CC: @ocombe
ocombe commentedon Jun 25, 2018
Hmm that sounds about right, good find both of you, thanks!
ocombe commentedon Jun 25, 2018
Actually the correct format will be
€ 123.456.789,00with the fix4 remaining items
cat-mandres commentedon Jun 25, 2018
I see.
So am I correct that the last symbol of the following line:
angular/packages/common/locales/de-AT.ts
Line 54 in 637805a
is the digit grouping symbol used for currencies if it is defined?
And if undefined it will fallback to the 2nd symbol of this line, the digit grouping symbol for decimals.
E.g. in the locales/de.ts file this last symbol is undefined, which means same symbol for decimals as for currencies?
ocombe commentedon Jun 25, 2018
Yes that is how the formatting rules are defined by CLDR, use the currency specific symbols if they are defined, or use the regular symbols otherwise.
fix(common): use correct currency format for locale de-AT (#24658)
docs: refactor pipe example to use the HttpClient (#22741)
angular-automatic-lock-bot commentedon Sep 13, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.