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

formatNumberlink

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

Formats a number as text, with group sizing, separator, and other\nparameters based on the locale.

\n\n \n
\n \n \n \n\n
\n \n\n formatNumber(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 text string.

\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" }