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

getLocaleNumberFormatlink

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

Retrieves a number format for a given locale.

\n\n

See more...

\n
\n \n \n \n\n
\n \n\n getLocaleNumberFormat(locale: string, type: NumberFormatStyle): string\n\n \n\n
Parameters
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n locale\n string\n

A locale code for the locale format rules to use.

\n\n
\n \n type\n NumberFormatStyle\n

The type of numeric value to be formatted (such as Decimal or Currency.)

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

string: The localized format string.

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

See alsolink

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

Descriptionlink

\n

Numbers are formatted using patterns, like #,###.00. For example, the pattern #,###.00\nwhen used to format the number 12345.678 could result in \"12'345,678\". That would happen if the\ngrouping separator for your language is an apostrophe, and the decimal separator is a comma.

\n

Important: The characters . , 0 # (and others below) are special placeholders\nthat stand for the decimal separator, and so on, and are NOT real characters.\nYou must NOT \"translate\" the placeholders. For example, don't change . to , even though in\nyour language the decimal point is written with a comma. The symbols should be replaced by the\nlocal equivalents, using the appropriate NumberSymbol for your language.

\n

Here are the special characters used in number patterns:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
SymbolMeaning
.Replaced automatically by the character used for the decimal point.
,Replaced by the \"grouping\" (thousands) separator.
0Replaced by a digit (or zero if there aren't enough digits).
#Replaced by a digit (or nothing if there aren't enough).
ยคReplaced by a currency symbol, such as $ or USD.
%Marks a percent format. The % symbol may change position, but must be retained.
EMarks a scientific format. The E symbol may change position, but must be retained.
'Special characters used as literal characters are quoted with ASCII single quotes.
\n\n \n
\n\n\n\n \n\n\n
\n
\n\n\n" }