summaryrefslogtreecommitdiff
path: root/Build/source/libs/icu/icu-4.6/test/testdata/dcfmtest.txt
blob: aed22fa532c44d3efb4e365d058294242b4de691 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129

# Note: Please make sure that this utf-8 file contains a BOM.
#   Copyright (c) 2010, International Business Machines Corporation and
#   others. All Rights Reserved.
#

#   File:  dcfmtest.txt
#
#       Decimal formatter test cases.
#       File Encoding:  UTF-8
#
#   The syntax for this file is this:
#   One test case per line.  No continuations.  No multiple cases per line.
#
#   Parsing Test case line:
#     parse "input text"  type "expected_decimal_text" 
#
#   Format Test Case Line:
#     format  pattern round-mode "decimal number" "expected formatted result"
#
#   Fields are separated by spaces or tabs.  Input text to be parsed, decimal numbers
#   and formatted output are "quoted".  Other fields are not.
#
#   "type" is a single letter,  representing the type that the ICU formattable produces
#   for the input.
#            d     double
#            i     int32
#            l     int64
#
#   RoundingMode is one of
#          default
#          ceiling
#          floor
#          down
#          up
#          halfeven
#          halfdown
#          halfup
#

parse  "123.45"   d "123.45"  

format 0.0000E0 default "1234.01" "1.2340E3"

format 00  default "1234" "1234"
format 00  default ".01"  "00"
format 00  default "1"    "01"
format 00  default "1.9"  "02"

format #.# default "12.34" "12.3"

format @@@   default  "12.3456"  "12.3"
format @@@   default  "123456"  "123000"
format @@@   default  ".00123456"  "0.00123"

format @@###  default "12345678"  "12346000"
format @@###  default "12300001"  "12300000"
format @@###  default ".0012345678"  "0.0012346"
format @@###  default ".0012300000"  "0.00123"

format @@@@E0  default "1234567"  "1.235E6"
format 0.0##E0 default "1234567"  "1.235E6"
format 00.##E0 default "1234567"  "12.35E5"
format 00.##E0 default "1234567E111"  "12.35E116"
format 00.##E0 default "-1234567E111"  "-12.35E116"


#
#  Rounding Modes
#  
format 0.00  default    "32.045" "32.04"
format 0.00  floor      "32.045" "32.04"
format 0.00  ceiling    "32.045" "32.05"
format 0.00  down       "32.045" "32.04"
format 0.00  up         "32.045" "32.05"
format 0.00  halfeven   "32.045" "32.04"
format 0.00  halfdown   "32.045" "32.04"
format 0.00  halfup     "32.045" "32.05"

format 0.00  default    "-32.045" "-32.04"
format 0.00  floor      "-32.045" "-32.05"
format 0.00  ceiling    "-32.045" "-32.04"
format 0.00  down       "-32.045" "-32.04"
format 0.00  up         "-32.045" "-32.05"
format 0.00  halfeven   "-32.045" "-32.04"
format 0.00  halfdown   "-32.045" "-32.04"
format 0.00  halfup     "-32.045" "-32.05"

format @@@   default    "1235.00"   "1240"
format @@@   floor      "1235.00"   "1230"
format @@@   ceiling    "1235.00"   "1240"
format @@@   down       "1235.00"   "1230"
format @@@   up         "1235.00"   "1240"
format @@@   halfeven   "1235.00"   "1240"
format @@@   halfdown   "1235.00"   "1230"
format @@@   halfup     "1235.00"   "1240"

format @@@   default    "-1235.00"   "-1240"
format @@@   floor      "-1235.00"   "-1240"
format @@@   ceiling    "-1235.00"   "-1230"
format @@@   down       "-1235.00"   "-1230"
format @@@   up         "-1235.00"   "-1240"
format @@@   halfeven   "-1235.00"   "-1240"
format @@@   halfdown   "-1235.00"   "-1230"
format @@@   halfup     "-1235.00"   "-1240"

format 0.000E0  default   "12345"    "1.234E4"
format 0.000E0  floor     "12345"    "1.234E4"
format 0.000E0  ceiling   "12345"    "1.235E4"
format 0.000E0  down      "12345"    "1.234E4"
format 0.000E0  up        "12345"    "1.235E4"
format 0.000E0  halfeven  "12345"    "1.234E4"
format 0.000E0  halfdown  "12345"    "1.234E4"
format 0.000E0  halfup    "12345"    "1.235E4"


format 0.0##    default   "1.00001"  "1.0"
format 0.0##    up        "1.00001"  "1.001"
format 0.0##    up        "1.0000000000000000000000000000000000000000000000000001"  "1.001"
format 0.0##    up        "1.0000000000000000000000000000000000000000000000000000"  "1.0"

format #        default   "10000000000000000000000000000000000000000000000000001" "10000000000000000000000000000000000000000000000000001" 

format 0.#E0    default   "1234"    "1.2E3"
format 0.##E0   default   "1234"    "1.23E3"
format .0E0     default   "1234"    ".1E4"
format .0#E0     default  "1234"    ".12E4"
format 0.##E0   default   "1234"    "1.23E3"