Created
March 29, 2020 23:56
-
-
Save Qarun-Qadir-Bissoondial/f1cbaaa5397a3a4f0887fb1c30976546 to your computer and use it in GitHub Desktop.
Pipes Demo - 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: 'app-decimal-pipe', | |
template: ` | |
<h2>Number-based Pipes!</h2> | |
<p>This is our small number: {{smallNumber}}</p> | |
<p>Decimal Pipe: {{smallNumber | number}} (This is 3 decimal places by default)</p> | |
<p>Decimal Pipe at 4 decimal places: {{smallNumber | number:'1.4'}}</p> | |
`, | |
styleUrls: [] | |
}) | |
export class DecimalPipeComponent { | |
smallNumber: number = 1/7; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment