docs: fix CurrencyPipe locale override example#69215
Open
erkamyaman wants to merge 1 commit into
Open
Conversation
The "Override current locale for CurrencyPipe" example used `{{ amount | currency: 'en-US' }}`, but the first `CurrencyPipe` argument is the currency code, not the locale, so `'en-US'` was treated as an invalid currency code (rendered literally as the symbol) and the locale was never overridden. Since `locale` is the fourth positional argument, the example now passes a valid currency code, display, and digits before it (`'USD' : 'symbol' : '1.2-2' : 'en-US'`), matching the parameter order shown on the CurrencyPipe API page.
JeanMeche
approved these changes
Jun 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The "Override current locale for CurrencyPipe" example used
{{ amount | currency: 'en-US' }}, but the firstCurrencyPipeargument is the currency code, not the locale, so'en-US'was treated as an invalid currency code (rendered literally as the symbol) and the locale was never overridden. Sincelocaleis the fourth positional argument, the example now passes a valid currency code, display, and digits before it ('USD' : 'symbol' : '1.2-2' : 'en-US'), matching the parameter order shown on the CurrencyPipe API page.PR Checklist
Please check that your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
On the Format data based on locale page, the "Override current locale for CurrencyPipe" section shows
{{ amount | currency: 'en-US' }}. The firstCurrencyPipeargument is the currency code, not the locale, so'en-US'is treated as a (non-existent) currency code, rendered literally as the symbol (e.g.en-US1,234.50), and the locale is never overridden. The example does not do what the section describes.What is the new behavior?
The example passes the locale as the fourth positional argument with valid preceding arguments:
{{ amount | currency: 'USD' : 'symbol' : '1.2-2' : 'en-US' }}, which actually overrides the locale. This matches the parameter order on theCurrencyPipeAPI page and its canonical example,packages/examples/common/pipes/ts/currency_pipe.ts, which uses the same shape ({{ b | currency: 'CAD' : 'symbol' : '4.2-2' : 'fr' }}). Only the code example changed; the surrounding prose is unchanged.Does this PR introduce a breaking change?