angular-cn/aio/dist/generated/docs/api/common/getLocaleNumberFormat.json

5 lines
7.1 KiB
JSON

{
"id": "api/common/getLocaleNumberFormat",
"title": "getLocaleNumberFormat",
"contents": "\n\n<article>\n <div class=\"breadcrumb-container\">\n <div class=\"breadcrumb\">\n <script type=\"application/ld+json\">\n {\n \"@context\": \"http://schema.org\",\n \"@type\": \"BreadcrumbList\",\n \"itemListElement\": [\n { \"@type\": \"ListItem\", \"position\": 1, \"item\": { \"@id\": \"https://angular.io//api\", \"name\": \"API\" } },\n { \"@type\": \"ListItem\", \"position\": 2, \"item\": { \"@id\": \"https://angular.io/api/common\", \"name\": \"@angular/common\" } },\n { \"@type\": \"ListItem\", \"position\": 3, \"item\": { \"@id\": \"https://angular.io/api/common/getLocaleNumberFormat\", \"name\": \"getLocaleNumberFormat\" } }\n ]\n }\n </script>\n <a href=\"/api\">API</a> > <a href=\"api/common\">@angular/common</a>\n </div>\n <div class=\"github-links\">\n <a href=\"https://github.com/angular/angular/edit/master/packages/common/src/i18n/locale_data_api.ts?message=docs(common)%3A%20describe%20your%20change...#L406-L445\" aria-label=\"Suggest Edits\" title=\"Suggest Edits\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">mode_edit</i></a>\n <a href=\"https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/src/i18n/locale_data_api.ts#L406-L445\" aria-label=\"View Source\" title=\"View Source\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">code</i></a>\n</div>\n </div>\n \n <header class=\"api-header\">\n <h1 id=\"getlocalenumberformat\">getLocaleNumberFormat<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/getLocaleNumberFormat#getlocalenumberformat\"><i class=\"material-icons\">link</i></a></h1>\n \n <label class=\"api-type-label function\">function</label>\n \n \n \n </header>\n \n <aio-toc class=\"embedded\"></aio-toc>\n\n <div class=\"api-body\">\n \n <section class=\"short-description\">\n <p>Retrieves a number format for a given locale.</p>\n\n <p><a href=\"api/common/getLocaleNumberFormat#description\">See more...</a></p>\n </section>\n \n \n \n\n <div class=\"overload-info\">\n \n\n <code-example language=\"ts\" hidecopy=\"true\" class=\"no-box api-heading\"> <span class=\"member-name\"><a href=\"api/common/getLocaleNumberFormat\" class=\"code-anchor\">getLocaleNumberFormat</a></span>(locale: string, type: <a href=\"api/common/NumberFormatStyle\" class=\"code-anchor\">NumberFormatStyle</a>): string</code-example>\n\n \n\n <h6 class=\"no-anchor\" id=\"parameters\">Parameters</h6>\n <table class=\"is-full-width list-table parameters-table function-overload-parameters\">\n <tbody>\n \n <tr class=\"function-overload-parameter\">\n <td class=\"param-name\">\n <a id=\"\"></a>\n <code>locale</code>\n </td>\n <td class=\"param-type\"><code>string</code></td>\n <td class=\"param-description\">\n <p>A locale code for the locale format rules to use.</p>\n\n </td>\n </tr>\n <tr class=\"function-overload-parameter\">\n <td class=\"param-name\">\n <a id=\"\"></a>\n <code>type</code>\n </td>\n <td class=\"param-type\"><code><a href=\"api/common/NumberFormatStyle\" class=\"code-anchor\">NumberFormatStyle</a></code></td>\n <td class=\"param-description\">\n <p>The type of numeric value to be formatted (such as <code>Decimal</code> or <code>Currency</code>.)</p>\n\n </td>\n </tr>\n </tbody>\n</table>\n\n \n <h6 class=\"no-anchor\" id=\"returns\">Returns</h6>\n <p><code>string</code>: The localized format string.</p>\n\n \n\n\n \n\n \n</div>\n\n\n \n<section class=\"see-also\">\n <h2 id=\"see-also\">See also<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/getLocaleNumberFormat#see-also\"><i class=\"material-icons\">link</i></a></h2>\n <ul>\n \n <li><p><code><a href=\"api/common/NumberFormatStyle\" class=\"code-anchor\">NumberFormatStyle</a></code></p>\n</li>\n <li><p><a href=\"http://cldr.unicode.org/translation/number-patterns\">CLDR website</a></p>\n</li>\n <li><p><a href=\"https://angular.io/guide/i18n\">Internationalization (i18n) Guide</a></p>\n</li>\n </ul>\n</section>\n\n\n \n\n<section class=\"description\">\n <h2 id=\"description\">Description<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/getLocaleNumberFormat#description\"><i class=\"material-icons\">link</i></a></h2>\n <p>Numbers are formatted using patterns, like <code>#,###.00</code>. For example, the pattern <code>#,###.00</code>\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.</p>\n<p><b>Important:</b> The characters <code>.</code> <code>,</code> <code>0</code> <code>#</code> (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 <code>.</code> to <code>,</code> 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 <code><a href=\"api/common/NumberSymbol\" class=\"code-anchor\">NumberSymbol</a></code> for your language.</p>\n<p>Here are the special characters used in number patterns:</p>\n<table>\n<thead>\n<tr>\n<th>Symbol</th>\n<th>Meaning</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>.</td>\n<td>Replaced automatically by the character used for the decimal point.</td>\n</tr>\n<tr>\n<td>,</td>\n<td>Replaced by the \"grouping\" (thousands) separator.</td>\n</tr>\n<tr>\n<td>0</td>\n<td>Replaced by a digit (or zero if there aren't enough digits).</td>\n</tr>\n<tr>\n<td>#</td>\n<td>Replaced by a digit (or nothing if there aren't enough).</td>\n</tr>\n<tr>\n<td>¤</td>\n<td>Replaced by a currency symbol, such as $ or USD.</td>\n</tr>\n<tr>\n<td>%</td>\n<td>Marks a percent format. The % symbol may change position, but must be retained.</td>\n</tr>\n<tr>\n<td>E</td>\n<td>Marks a scientific format. The E symbol may change position, but must be retained.</td>\n</tr>\n<tr>\n<td>'</td>\n<td>Special characters used as literal characters are quoted with ASCII single quotes.</td>\n</tr>\n</tbody>\n</table>\n\n \n</section>\n\n\n\n \n\n\n </div>\n</article>\n\n<!-- links to this doc:\n - api/common\n - api/common/NumberFormatStyle\n-->\n<!-- links from this doc:\n - /api\n - api/common\n - api/common/NumberFormatStyle\n - api/common/NumberSymbol\n - api/common/getLocaleNumberFormat#description\n - api/common/getLocaleNumberFormat#getlocalenumberformat\n - api/common/getLocaleNumberFormat#see-also\n - http://cldr.unicode.org/translation/number-patterns\n - https://angular.io/guide/i18n\n - https://github.com/angular/angular/edit/master/packages/common/src/i18n/locale_data_api.ts?message=docs(common)%3A%20describe%20your%20change...#L406-L445\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/src/i18n/locale_data_api.ts#L406-L445\n-->"
}