Last active
May 24, 2017 04:43
Decimal Pipe
This file contains 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
import {Component} from '@angular/core'; | |
@Component({ | |
selector: 'decimal-pipe', | |
template: ` | |
<h2>Decimal Pipe Example</h2> | |
<p>pi (no formatting): {{pi}}</p> | |
<p>pi (.5-5): {{pi | number:'.5-5'}}</p> | |
<p>pi (2.10-10): {{pi | number:'2.10-10'}}</p> | |
<p>pi (.3-3): {{pi | number:'.3-3'}}</p> | |
` | |
}) | |
export class DecimalPipe { | |
pi: number = 3.1415927; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment