I am using Angular 2 localization support for dates and currencies.
Localization is configured at the level of the main application module. In my application module settings, if I configured the provider LOCALE_IDmagically, I have localization support.
@NgModule({
imports: [ BrowserModule ],
declarations: [ AppComponent ],
providers: [
{ provide: LOCALE_ID, useValue: 'nl' }
],
bootstrap: [ AppComponent ]
})
export class AppModule { }
Now, if I use a currency pipe in my application as follows:
@Component({
selector: 'my-app',
template: '<h1>{{title}}</h1>' +
'<div>{{convertNumber | currency}}</div>',
})
export class AppComponent {
title = 'Currency Test';
convertNumber = '12.30';
}
You can find a working example in this plnkr code .
I got this conclusion USD 12,30.
The exchange rate for the Netherlands is not the dollar.
Based on this question, I have two questions:
- When do I set up
LOCALE_IDwhat exactly happens? Where is this localization file? USD EUR, . (, €) (€), (EUR).
-, Angular 2 .
?
.