OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 library number_symbols; | 4 library number_symbols; |
5 | 5 |
6 /** | 6 /// This holds onto information about how a particular locale formats |
7 * This holds onto information about how a particular locale formats numbers. It | 7 /// numbers. It contains strings for things like the decimal separator, digit to |
8 * contains strings for things like the decimal separator, digit to use for "0" | 8 /// use for "0" and infinity. We expect the data for instances to be generated |
9 * and infinity. We expect the data for instances to be generated out of ICU | 9 /// out of ICU or a similar reference source. |
10 * or a similar reference source. | |
11 */ | |
12 class NumberSymbols { | 10 class NumberSymbols { |
13 final String NAME; | 11 final String NAME; |
14 final String DECIMAL_SEP, | 12 final String DECIMAL_SEP, |
15 GROUP_SEP, | 13 GROUP_SEP, |
16 PERCENT, | 14 PERCENT, |
17 ZERO_DIGIT, | 15 ZERO_DIGIT, |
18 PLUS_SIGN, | 16 PLUS_SIGN, |
19 MINUS_SIGN, | 17 MINUS_SIGN, |
20 EXP_SYMBOL, | 18 EXP_SYMBOL, |
21 PERMILL, | 19 PERMILL, |
22 INFINITY, | 20 INFINITY, |
23 NAN, | 21 NAN, |
24 DECIMAL_PATTERN, | 22 DECIMAL_PATTERN, |
25 SCIENTIFIC_PATTERN, | 23 SCIENTIFIC_PATTERN, |
26 PERCENT_PATTERN, | 24 PERCENT_PATTERN, |
27 CURRENCY_PATTERN, | 25 CURRENCY_PATTERN, |
28 DEF_CURRENCY_CODE; | 26 DEF_CURRENCY_CODE; |
29 | 27 |
30 const NumberSymbols({this.NAME, this.DECIMAL_SEP, this.GROUP_SEP, | 28 const NumberSymbols( |
31 this.PERCENT, this.ZERO_DIGIT, this.PLUS_SIGN, this.MINUS_SIGN, | 29 {this.NAME, |
32 this.EXP_SYMBOL, this.PERMILL, this.INFINITY, this.NAN, | 30 this.DECIMAL_SEP, |
33 this.DECIMAL_PATTERN, this.SCIENTIFIC_PATTERN, this.PERCENT_PATTERN, | 31 this.GROUP_SEP, |
34 this.CURRENCY_PATTERN, this.DEF_CURRENCY_CODE}); | 32 this.PERCENT, |
| 33 this.ZERO_DIGIT, |
| 34 this.PLUS_SIGN, |
| 35 this.MINUS_SIGN, |
| 36 this.EXP_SYMBOL, |
| 37 this.PERMILL, |
| 38 this.INFINITY, |
| 39 this.NAN, |
| 40 this.DECIMAL_PATTERN, |
| 41 this.SCIENTIFIC_PATTERN, |
| 42 this.PERCENT_PATTERN, |
| 43 this.CURRENCY_PATTERN, |
| 44 this.DEF_CURRENCY_CODE}); |
35 | 45 |
36 toString() => NAME; | 46 toString() => NAME; |
37 } | 47 } |
| 48 |
| 49 class CompactNumberSymbols { |
| 50 final Map<int, String> COMPACT_DECIMAL_SHORT_PATTERN; |
| 51 final Map<int, String> COMPACT_DECIMAL_LONG_PATTERN; |
| 52 final Map<int, String> COMPACT_DECIMAL_SHORT_CURRENCY_PATTERN; |
| 53 CompactNumberSymbols( |
| 54 {this.COMPACT_DECIMAL_SHORT_PATTERN, |
| 55 this.COMPACT_DECIMAL_LONG_PATTERN, |
| 56 this.COMPACT_DECIMAL_SHORT_CURRENCY_PATTERN}); |
| 57 } |
OLD | NEW |