Angular 12 References/ Templates
🍀 Angular References

percent pipe

Transforms a number to a percentage string, formatted according to locale rules that determine group sizing and separator, decimal-point character, and other locale-specific configurations.

<p>A: {{a | percent}}</p>
<p>B: {{b | percent:'4.3-5'}}</p>
export class AppComponent {
  a = 0.259;
  b = 1.3495;

A: 26%

B: 0,134.950%


{{ value_expression | percent [ : digitsInfo [ : locale ] ] }}


digitsInfo?: string

Decimal representation options.

Specified by a string in the following format:

  • minIntegerDigits: The minimum number of integer digits before the decimal point. Default is 1.
  • minFractionDigits: The minimum number of digits after the decimal point. Default is 0.
  • maxFractionDigits: The maximum number of digits after the decimal point. Default is 3.


locale?: string

A locale code for the locale format rules to use.

When not supplied, uses the value of LOCALE_ID, which is en-US by default. See Setting your app locale.