28
loading...
This website collects cookies to deliver better user experience
Pipes
pipe-demo
CurrencyPipe
{{ value_expression | currency [ : currencyCode [ : display [ : digitsInfo
[ : locale ] ] ] ] }}
symbol
(the currency symbol eg $) code
or symbol-narrow
or our own custom string
.expense
, and initialize it with the value 786.4589
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-pipe-demo',
templateUrl: './pipe-demo.component.html',
styleUrls: ['./pipe-demo.component.css']
})
export class PipeDemoComponent implements OnInit {
expense = 786.4589;
constructor() { }
ngOnInit(): void {
}
}
{{ expense | currency }}
{{ expense | currency: "INR" }}
code
, symbol
or symbol-narrow
or any other custom value
too.<hr />
<h3>{{ expense | currency: "INR":"code" }}</h3>
<h3>{{ expense | currency: "CAD":"symbol" }}</h3>
<h3>{{ expense | currency: "CAD":"symbol-narrow" }}</h3>
<h3>{{ expense | currency: "INR":"symbol-narrow" }}</h3>
<h3>{{ expense | currency: "INR":"Indian Rupee" }}</h3>
{{ expense | currency: "CAD":"symbol" }}
expense | currency: "CAD":"symbol-narrow"
expense | currency: "INR":"symbol-narrow"
expense | currency: "INR":"Indian Rupee"
digitsInfo
parameter.<hr />
<h3>{{ expense | currency: "INR":"symbol":"4.2-2" }}</h3>
<h3>{{ expense | currency: "INR":"symbol":"3.1-1" }}</h3>
{{ expense | currency: "INR":"symbol":"4.2-2" }}