/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {registerLocaleData} from '@angular/common'; import {Component} from '@angular/core'; // we need to import data for the french locale import localeFr from './locale-fr'; // registering french data registerLocaleData(localeFr); // #docregion CurrencyPipe @Component({ selector: 'currency-pipe', template: `
A: {{a | currency}}
A: {{a | currency:'CAD'}}
A: {{a | currency:'CAD':'code'}}
B: {{b | currency:'CAD':'symbol':'4.2-2'}}
B: {{b | currency:'CAD':'symbol-narrow':'4.2-2'}}
B: {{b | currency:'CAD':'symbol':'4.2-2':'fr'}}
B: {{b | currency:'CLP'}}
A: {{a | currency:'CAD'}}
B: {{b | currency:'CAD':true:'4.2-2'}}