1
|
/**
|
2
|
* @license
|
3
|
* Copyright Google Inc. All Rights Reserved.
|
4
|
*
|
5
|
* Use of this source code is governed by an MIT-style license that can be
|
6
|
* found in the LICENSE file at https://angular.io/license
|
7
|
*/
|
8
|
import { PipeTransform } from '@angular/core';
|
9
|
/**
|
10
|
* @ngModule CommonModule
|
11
|
* @whatItDoes Formats a number according to locale rules.
|
12
|
* @howToUse `number_expression | number[:digitInfo]`
|
13
|
*
|
14
|
* Formats a number as text. Group sizing and separator and other locale-specific
|
15
|
* configurations are based on the active locale.
|
16
|
*
|
17
|
* where `expression` is a number:
|
18
|
* - `digitInfo` is a `string` which has a following format: <br>
|
19
|
* <code>{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}</code>
|
20
|
* - `minIntegerDigits` is the minimum number of integer digits to use. Defaults to `1`.
|
21
|
* - `minFractionDigits` is the minimum number of digits after fraction. Defaults to `0`.
|
22
|
* - `maxFractionDigits` is the maximum number of digits after fraction. Defaults to `3`.
|
23
|
*
|
24
|
* For more information on the acceptable range for each of these numbers and other
|
25
|
* details see your native internationalization library.
|
26
|
*
|
27
|
* WARNING: this pipe uses the Internationalization API which is not yet available in all browsers
|
28
|
* and may require a polyfill. See [Browser Support](guide/browser-support) for details.
|
29
|
*
|
30
|
* ### Example
|
31
|
*
|
32
|
* {@example common/pipes/ts/number_pipe.ts region='NumberPipe'}
|
33
|
*
|
34
|
* @stable
|
35
|
*/
|
36
|
export declare class DecimalPipe implements PipeTransform {
|
37
|
private _locale;
|
38
|
constructor(_locale: string);
|
39
|
transform(value: any, digits?: string): string | null;
|
40
|
}
|
41
|
/**
|
42
|
* @ngModule CommonModule
|
43
|
* @whatItDoes Formats a number as a percentage according to locale rules.
|
44
|
* @howToUse `number_expression | percent[:digitInfo]`
|
45
|
*
|
46
|
* @description
|
47
|
*
|
48
|
* Formats a number as percentage.
|
49
|
*
|
50
|
* - `digitInfo` See {@link DecimalPipe} for detailed description.
|
51
|
*
|
52
|
* WARNING: this pipe uses the Internationalization API which is not yet available in all browsers
|
53
|
* and may require a polyfill. See [Browser Support](guide/browser-support) for details.
|
54
|
*
|
55
|
* ### Example
|
56
|
*
|
57
|
* {@example common/pipes/ts/number_pipe.ts region='PercentPipe'}
|
58
|
*
|
59
|
* @stable
|
60
|
*/
|
61
|
export declare class PercentPipe implements PipeTransform {
|
62
|
private _locale;
|
63
|
constructor(_locale: string);
|
64
|
transform(value: any, digits?: string): string | null;
|
65
|
}
|
66
|
/**
|
67
|
* @ngModule CommonModule
|
68
|
* @whatItDoes Formats a number as currency using locale rules.
|
69
|
* @howToUse `number_expression | currency[:currencyCode[:symbolDisplay[:digitInfo]]]`
|
70
|
* @description
|
71
|
*
|
72
|
* Use `currency` to format a number as currency.
|
73
|
*
|
74
|
* - `currencyCode` is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, such
|
75
|
* as `USD` for the US dollar and `EUR` for the euro.
|
76
|
* - `symbolDisplay` is a boolean indicating whether to use the currency symbol or code.
|
77
|
* - `true`: use symbol (e.g. `$`).
|
78
|
* - `false`(default): use code (e.g. `USD`).
|
79
|
* - `digitInfo` See {@link DecimalPipe} for detailed description.
|
80
|
*
|
81
|
* WARNING: this pipe uses the Internationalization API which is not yet available in all browsers
|
82
|
* and may require a polyfill. See [Browser Support](guide/browser-support) for details.
|
83
|
*
|
84
|
* ### Example
|
85
|
*
|
86
|
* {@example common/pipes/ts/number_pipe.ts region='CurrencyPipe'}
|
87
|
*
|
88
|
* @stable
|
89
|
*/
|
90
|
export declare class CurrencyPipe implements PipeTransform {
|
91
|
private _locale;
|
92
|
constructor(_locale: string);
|
93
|
transform(value: any, currencyCode?: string, symbolDisplay?: boolean, digits?: string): string | null;
|
94
|
}
|
95
|
export declare function isNumeric(value: any): boolean;
|