@@ -20,16 +20,6 @@ import {invalidPipeArgumentError} from './invalid_pipe_argument_error';
20
20
* Formats a number as text. Group sizing and separator and other locale-specific
21
21
* configurations are based on the locale.
22
22
*
23
- * Where:
24
- * - `value` is a number
25
- * - `digitInfo` is a `string` which has a following format: <br>
26
- * <code>{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}</code>.
27
- * - `minIntegerDigits` is the minimum number of integer digits to use. Defaults to `1`.
28
- * - `minFractionDigits` is the minimum number of digits after the decimal point. Defaults to `0`.
29
- * - `maxFractionDigits` is the maximum number of digits after the decimal point. Defaults to `3`.
30
- * - `locale` is a `string` defining the locale to use (uses the current {@link LOCALE_ID} by
31
- * default).
32
- *
33
23
* ### Example
34
24
*
35
25
* {@example common/pipes/ts/number_pipe.ts region='NumberPipe'}
@@ -40,6 +30,16 @@ import {invalidPipeArgumentError} from './invalid_pipe_argument_error';
40
30
export class DecimalPipe implements PipeTransform {
41
31
constructor ( @Inject ( LOCALE_ID ) private _locale : string ) { }
42
32
33
+ /**
34
+ * @param value a number to be formatted.
35
+ * @param digitsInfo a `string` which has a following format: <br>
36
+ * <code>{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}</code>.
37
+ * - `minIntegerDigits` is the minimum number of integer digits to use. Defaults to `1`.
38
+ * - `minFractionDigits` is the minimum number of digits after the decimal point. Defaults to `0`.
39
+ * - `maxFractionDigits` is the maximum number of digits after the decimal point. Defaults to `3`.
40
+ * @param locale a `string` defining the locale to use (uses the current {@link LOCALE_ID} by
41
+ * default).
42
+ */
43
43
transform ( value : any , digitsInfo ?: string , locale ?: string ) : string | null {
44
44
if ( isEmpty ( value ) ) return null ;
45
45
@@ -61,12 +61,6 @@ export class DecimalPipe implements PipeTransform {
61
61
* Uses the function {@link formatPercent} to format a number as a percentage according
62
62
* to locale rules.
63
63
*
64
- * Where:
65
- * - `value` is a number.
66
- * - `digitInfo` See {@link DecimalPipe} for more details.
67
- * - `locale` is a `string` defining the locale to use (uses the current {@link LOCALE_ID} by
68
- * default).
69
- *
70
64
* ### Example
71
65
*
72
66
* {@example common/pipes/ts/percent_pipe.ts region='PercentPipe'}
@@ -77,6 +71,13 @@ export class DecimalPipe implements PipeTransform {
77
71
export class PercentPipe implements PipeTransform {
78
72
constructor ( @Inject ( LOCALE_ID ) private _locale : string ) { }
79
73
74
+ /**
75
+ *
76
+ * @param value a number to be formatted as a percentage.
77
+ * @param digitsInfo see {@link DecimalPipe} for more details.
78
+ * @param locale a `string` defining the locale to use (uses the current {@link LOCALE_ID} by
79
+ * default).
80
+ */
80
81
transform ( value : any , digitsInfo ?: string , locale ?: string ) : string | null {
81
82
if ( isEmpty ( value ) ) return null ;
82
83
@@ -98,22 +99,6 @@ export class PercentPipe implements PipeTransform {
98
99
* Uses the functions {@link getCurrencySymbol} and {@link formatCurrency} to format a
99
100
* number as currency using locale rules.
100
101
*
101
- * Where:
102
- * - `value` is a number.
103
- * - `currencyCode` is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, such
104
- * as `USD` for the US dollar and `EUR` for the euro.
105
- * - `display` indicates whether to show the currency symbol, the code or a custom value:
106
- * - `code`: use code (e.g. `USD`).
107
- * - `symbol`(default): use symbol (e.g. `$`).
108
- * - `symbol-narrow`: some countries have two symbols for their currency, one regular and one
109
- * narrow (e.g. the canadian dollar CAD has the symbol `CA$` and the symbol-narrow `$`).
110
- * - `string`: use this value instead of a code or a symbol.
111
- * - boolean (deprecated from v5): `true` for symbol and false for `code`.
112
- * If there is no narrow symbol for the chosen currency, the regular symbol will be used.
113
- * - `digitInfo` See {@link DecimalPipe} for more details.
114
- * - `locale` is a `string` defining the locale to use (uses the current {@link LOCALE_ID} by
115
- * default).
116
- *
117
102
* ### Example
118
103
*
119
104
* {@example common/pipes/ts/currency_pipe.ts region='CurrencyPipe'}
@@ -124,6 +109,23 @@ export class PercentPipe implements PipeTransform {
124
109
export class CurrencyPipe implements PipeTransform {
125
110
constructor ( @Inject ( LOCALE_ID ) private _locale : string ) { }
126
111
112
+ /**
113
+ *
114
+ * @param value a number to be formatted as currency.
115
+ * @param currencyCodeis the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, such
116
+ * as `USD` for the US dollar and `EUR` for the euro.
117
+ * @param display indicates whether to show the currency symbol, the code or a custom value:
118
+ * - `code`: use code (e.g. `USD`).
119
+ * - `symbol`(default): use symbol (e.g. `$`).
120
+ * - `symbol-narrow`: some countries have two symbols for their currency, one regular and one
121
+ * narrow (e.g. the canadian dollar CAD has the symbol `CA$` and the symbol-narrow `$`).
122
+ * - `string`: use this value instead of a code or a symbol.
123
+ * - boolean (deprecated from v5): `true` for symbol and false for `code`.
124
+ * If there is no narrow symbol for the chosen currency, the regular symbol will be used.
125
+ * @param digitsInfo see {@link DecimalPipe} for more details.
126
+ * @param locale a `string` defining the locale to use (uses the current {@link LOCALE_ID} by
127
+ * default).
128
+ */
127
129
transform (
128
130
value : any , currencyCode ?: string ,
129
131
display : 'code' | 'symbol' | 'symbol-narrow' | string | boolean = 'symbol' , digitsInfo ?: string ,
0 commit comments