Angular 9 References/ Templates
References

percent pipe

This is the documentation for Angular 9.
You can switch to the latest version Angular 10.

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.

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

A: 26%

B: 0,134.950%

Parameters

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

digitsInfo#

digitsInfo?: string
Decimal representation options.Specified by a string in the following format: ``` {minIntegerDigits}.{minFractionDigits}-{maxFractionDigits} ``` - `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#

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](https://angular.io/guide/i18n#setting-up-the-locale-of-your-app).