Angular Pipe Number 2 Decimal Places Example
Today our leading topic is angular pipe number 2 decimal places. Here you will learn angular pipe decimal 2 digits. you'll learn angular decimal pipe 2 digits. if you want to see example of angular 2 digit after decimal point pipe then you are a right place.
you can easily use pipe for 2 digits after decimal point in angular 7, angular 8, angular 9, angular 10 and angular 11 version.
here, you have to follow few step to create simple example of pipe 2 digits after decimal point.
In this simple example, you can see i take two variable and it's has 3 or 4 digits after decimal point. so let's see how to display with 2 digits after decimal point.
app/app.component.ts
import { Component, VERSION } from "@angular/core";
@Component({
selector: "my-app",
templateUrl: "./app.component.html",
styleUrls: ["./app.component.css"]
})
export class AppComponent {
name = "Angular " + VERSION.major;
myNumber = 34.5673;
myNumber2 = 104.566445;
}
Ok, now we can use custom pipe in html file, so let's write it.
app/app.component.html
<h1>angular pipe number 2 decimal places Example - ItSolutionStuff.com</h1>
<p>{{ myNumber | number : '1.2-2' }}</p>
<p>{{ myNumber2 | number : '1.2-2' }}</p>
Output:
I hope it can help you...

My name is Hardik Savani. I'm a full-stack developer, entrepreneur and owner of Aatman Infotech. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Javascript, JQuery, Laravel, Codeigniter, VueJS, AngularJS and Bootstrap from the early stage.
- Angular Pipe for Boolean Value with Yes No Text
- Angular Pipe for Alphabetical Order Example
- Angular Pipe for Phone Number Example
- Angular Create Custom Pipe for Replace Null Values Example
- Angular 11/10 Create Custom Pipe Example
- Angular 10/9/8 Pipes Example | Angular Pipes List Tutorial
- Angular 10/9/8 Uppercase Pipe Example | Uppercase Pipe in Angular
- Angular 10/9/8 Decimal Pipe Example | Number Pipe in Angular
- Angular nl2br Pipe Example