percent pipe
This is the documentation for Angular 6.
You can switch to the latest version Angular 10.
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
locale
#
locale?: string