• Overview
@angular/core

DEFAULT_CURRENCY_CODE

constant
stable

Provide this token to set the default currency code your application uses for CurrencyPipe when there is no currency code passed into it. This is only used by CurrencyPipe and has no relation to locale currency. Defaults to USD if not configured.

API

Description

Provide this token to set the default currency code your application uses for CurrencyPipe when there is no currency code passed into it. This is only used by CurrencyPipe and has no relation to locale currency. Defaults to USD if not configured.

See the i18n guide for more information.

The default currency code is currently always USD.

If you need the previous behavior then set it by creating a DEFAULT_CURRENCY_CODE provider in your application NgModule:

          
{provide: DEFAULT_CURRENCY_CODE, useValue: 'USD'}

Usage Notes

Example

In standalone apps:

          
import { LOCALE_ID, ApplicationConfig } from '@angular/core';import { AppModule } from './app/app.module';const appConfig: ApplicationConfig = {  providers: [{provide: DEFAULT_CURRENCY_CODE, useValue: 'EUR' }]};

In module based apps:

          
import { platformBrowser } from '@angular/platform-browser';import { AppModule } from './app/app.module';platformBrowser().bootstrapModule(AppModule, {  providers: [{provide: DEFAULT_CURRENCY_CODE, useValue: 'EUR' }]});
Jump to details