/** * @license * Copyright Google Inc. 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 NumberPipe @Component({ selector: 'number-pipe', template: `
e (no formatting): {{e | number}}
e (3.1-5): {{e | number:'3.1-5'}}
e (3.5-5): {{e | number:'4.5-5'}}
e (french): {{e | number:'4.5-5':'fr'}}
pi (no formatting): {{e | number}}
pi (3.1-5): {{e | number:'3.1-5'}}
pi (3.5-5): {{e | number:'3.5-5'}}
e (no formatting): {{e}}
e (3.1-5): {{e | number:'3.1-5'}}
pi (no formatting): {{pi}}
pi (3.5-5): {{pi | number:'3.5-5'}}