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

5 lines
26 KiB
JSON

{
"id": "api/common/formatCurrency",
"title": "formatCurrency",
"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/formatCurrency\", \"name\": \"formatCurrency\" } }\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/format_number.ts?message=docs(common)%3A%20describe%20your%20change...#L124-L170\" 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/format_number.ts#L124-L170\" 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=\"formatcurrency\">formatCurrency<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/formatCurrency#formatcurrency\"><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>Formats a number as currency using locale rules.</p>\n\n \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/formatCurrency\" class=\"code-anchor\">formatCurrency</a></span>(value: number, locale: string, currency: string, currencyCode?: string, digitsInfo?: string): 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>value</code>\n </td>\n <td class=\"param-type\"><code><a href=\"api/common/DecimalPipe\" class=\"code-anchor\">number</a></code></td>\n <td class=\"param-description\">\n <p>The number to format.</p>\n\n </td>\n </tr>\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><a href=\"api/common/CurrencyPipe\" class=\"code-anchor\">currency</a></code>\n </td>\n <td class=\"param-type\"><code>string</code></td>\n <td class=\"param-description\">\n <p>A string containing the currency symbol or its name,\nsuch as \"$\" or \"Canadian Dollar\". Used in output string, but does not affect the operation\nof the function.</p>\n\n </td>\n </tr>\n <tr class=\"function-overload-parameter\">\n <td class=\"param-name\">\n <a id=\"\"></a>\n <code>currencyCode</code>\n </td>\n <td class=\"param-type\"><code>string</code></td>\n <td class=\"param-description\">\n <p>The <a href=\"https://en.wikipedia.org/wiki/ISO_4217\">ISO 4217</a>\ncurrency code, such as <code>USD</code> for the US dollar and <code>EUR</code> for the euro.\nUsed to determine the number of digits in the decimal part.</p>\n<p> Optional. Default is <code>undefined</code>.</p>\n\n </td>\n </tr>\n <tr class=\"function-overload-parameter\">\n <td class=\"param-name\">\n <a id=\"\"></a>\n <code>digitsInfo</code>\n </td>\n <td class=\"param-type\"><code>string</code></td>\n <td class=\"param-description\">\n <p>Decimal representation options, specified by a string in the following format:\n<code>{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}</code>. See <code><a href=\"api/common/DecimalPipe\" class=\"code-anchor\">DecimalPipe</a></code> for more details.</p>\n<p> Optional. Default is <code>undefined</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 formatted currency value.</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/formatCurrency#see-also\"><i class=\"material-icons\">link</i></a></h2>\n <ul>\n \n <li><p><code><a href=\"api/common/formatNumber\" class=\"code-anchor\">formatNumber</a>()</code></p>\n</li>\n <li><p><code><a href=\"api/common/DecimalPipe\" class=\"code-anchor\">DecimalPipe</a></code></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\n\n \n\n\n </div>\n</article>\n\n<!-- links to this doc:\n - api/common\n - api/common/CurrencyPipe\n-->\n<!-- links from this doc:\n - /api\n - api/common\n - api/common/CurrencyPipe\n - api/common/DecimalPipe\n - api/common/formatCurrency#formatcurrency\n - api/common/formatCurrency#see-also\n - api/common/formatNumber\n - https://angular.io/guide/i18n\n - https://en.wikipedia.org/wiki/ISO_4217\n - https://github.com/angular/angular/edit/master/packages/common/src/i18n/format_number.ts?message=docs(common)%3A%20describe%20your%20change...#L124-L170\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/src/i18n/format_number.ts#L124-L170\n-->"
}