Last Updated : 23 Jul, 2025
In this article, we are going to see what is percentPipe in Angular 10 and how to use it.
The percentPipe is used to Transform a number to a percentage string.
Syntax:
{{ value | percent [ : digitsInfo [ : locale ] ] }}
NgModule: Module used by percentPipe is:
Approach:
Input value:
Parameters:
Example 1:
Filename: app.component.ts javascript
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html'
})
export class AppComponent {
geeks: number = 0.4945;
gfg: number = 2.343564;
}
Filename: app.component.html html
<div>
<p>1st: {{gfg | percent}}</p>
<p>2nd: {{geeks | percent:'4.3-5'}}</p>
</div>
Output:
Example 2:
Filename: app.component.ts javascript
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html'
})
export class AppComponent {
geeks: number = 100;
}
Filename: app.component.html html
<div>
<p>1st: {{geeks | percent }}</p>
<p>2nd: {{geeks | percent:'3.4-5' }}</p>
</div>
Output:
Reference: https://v17.angular.io/api/common/PercentPipe
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4