formatPercent
function
stable
Formats a number as a percentage according to locale rules.
API
function formatPercent(
value: number,
locale: string,
digitsInfo?: string | undefined,
): string;@paramvalue
numberThe number to format.
@paramlocale
stringA locale code for the locale format rules to use.
@paramdigitsInfo
string | undefinedDecimal representation options, specified by a string in the following format:
{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}. See DecimalPipe for more details.
@returns
stringThe formatted percentage value.
Jump to details