{ "id": "api/common/formatPercent", "title": "formatPercent", "contents": "\n\n
\n
\n
\n \n API > @angular/common\n
\n \n
\n \n
\n

formatPercentlink

\n \n \n \n \n \n
\n \n \n\n
\n \n
\n

Formats a number as a percentage according to locale rules.

\n\n \n
\n \n \n \n\n
\n \n\n formatPercent(value: number, locale: string, digitsInfo?: string): string\n\n \n\n
Parameters
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n value\n number\n

The number to format.

\n\n
\n \n locale\n string\n

A locale code for the locale format rules to use.

\n\n
\n \n digitsInfo\n string\n

Decimal representation options, specified by a string in the following format:\n{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}. See DecimalPipe for more details.

\n

Optional. Default is undefined.

\n\n
\n\n \n
Returns
\n

string: The formatted percentage value.

\n \n \n\n\n \n\n \n
\n\n\n \n
\n

See alsolink

\n \n
\n\n\n \n\n\n\n \n\n\n
\n
\n\n\n" }