Skip to content

CurrencyPipe should default to LOCALE_ID's currency #47612

@Jacobra93

Description

@Jacobra93

Which @angular/* package(s) are the source of the bug?

core

Is this a regression?

No

Description

When using CurrencyPipe I expect it to default the currency to the locale supplied by LOCALE_ID, not to USD.

https://angular.io/api/common/CurrencyPipe#description
From the docs:
"Deprecation notice:
The default currency code is currently always USD but this is deprecated from v9.
In v11 the default currency code will be taken from the current locale identified by the LOCALE_ID token."

From this description I would expect from v11 onwards, that USD would not be the default currency, but the wording is confusing so I'm not sure if this is intended behavior or a bug. If this is the intended behavior, maybe we could make the docs a little bit clearer.

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/angular-ivy-eec1py?file=src%2Fapp%2Fapp.module.ts

Please provide the exception or error you saw

No response

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 13.0.1
Node: 16.14.2
Package Manager: npm 8.5.4
OS: darwin x64

Angular:
...

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.1300.1 (cli-only)
@angular-devkit/core         13.0.1 (cli-only)
@angular-devkit/schematics   13.0.1 (cli-only)
@schematics/angular          13.0.1 (cli-only)

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2The issue is important to a large percentage of users, with a workaroundarea: commonIssues related to APIs in the @angular/common package

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions