1 // Copyright (C) 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 // Copyright (C) 2015-2016, International Business Machines
4 // Corporation and others. All Rights Reserved.
6 // This file is divided into test suites separated by whitespace. Each test
7 // suite starts with the name of the test followed by global field settings
8 // for that test suite. After the global settings, comes "begin", the
9 // per-test field names, and finally the test specific field values, 1 test
13 // J = ICU4J (current)
14 // K = JDK (ignored if not OpenJDK 1.8)
15 // C = ICU4C (current)
16 // P = Properties-based ICU4J (bypasses DecimalFormat wrapper)
18 // For more information on the format of this file, including all the available
19 // field names, please see
20 // https://docs.google.com/document/d/1T2P0p953_Lh1pRwo-5CuPVrHlIBa_wcXElG-Hhg_WHM/edit?usp=sharing
35 // K does not use \u202f narrow space
36 #,##0.## 1\u202f234,57 K
39 #,##0.### 1\u202f234,567 K
43 #,##0.00 \u00a4 1\u202f234,57 \u20ac K
44 'tick''bitten '0.00 tick'bitten 1234,57
45 'tick' 'bitten '0.00 tick bitten 1234,57
48 test minimum and maximum fraction digits
50 set minIntegerDigits 2
51 set maxIntegerDigits 4
52 set minFractionDigits 3
53 set maxFractionDigits 5
59 1002003004005 4005.000
60 -1002003004005 -4005.000
65 test patterns with no '0' symbols
68 pattern format output breaks
94 test behavior on numbers approaching zero
97 pattern format output breaks
108 // Not in official spec, but needed for backwards compatibility
109 test patterns with leading grouping separator
112 pattern format output breaks
116 test patterns with valid and invalid quote marks
119 pattern format output breaks
126 // K doesn't know the locale symbol for et
138 1002003004005 1002003004005
139 -1002003004005 -1002003004005
144 pattern format output breaks
154 #,#3.70 104.0 1\u202f03,60 K
156 test significant digits
158 set pattern #,#@,@###
169 -1234567 -1,23,4600 K
172 test scientific notation
175 pattern format output breaks
177 000.00E0 12300 123,00E2
178 000.0#E0 12300 123,0E2
179 000.0#E0 12300.1 123,0E2
180 000.0#E0 12301.0 123,01E2
181 // JDK does not support exponent signs
182 000.0#E+00 12301.0 123,01E+02 K
183 // JDK gives 12,345E3. JDK seems to include the hashes in significant digits
184 ##0.00E0 12345 12,3E3 K
185 // JDK gives 12,3001E3
186 ##0.0000E0 12300.1 12,300E3 K
187 // JDK gives 12,3001E3
188 ##0.000#E0 12300.1 12,30E3 K
189 ##0.000#E0 12301 12,301E3
190 0.05E0 12301.2 1,25E4 K
191 ##0.000#E0 0.17 170,0E-3
192 // JDK doesn't support significant digits in exponents
196 @@@#E0 6201 6,201E3 K
197 @@@#E0 6201.7 6,202E3 K
198 @@@#E00 6201.7 6,202E03 K
199 @@@#E+00 6201.7 6,202E+03 K
200 // If no zeros are specified, significant digits is fraction length plus 1
202 ###.##E0 52413 52,4E3 K
206 test scientific infinite precision
207 // ICU-11511, ICU-7460, CLDR-10103
210 pattern format output breaks
212 // "0.##E0 means a max of 3 significant digits."
214 // "#.##E0 also means a max of 3 significant digits."
216 // "#.0#E0 means a max of 2 significant digits."
218 // "0E0 means a max of 1 significant digit."
220 // "#E0 means infinite precision."
222 // "###E0 means engineering notation with infinite precision."
223 ###E0 98760 98.76E3 K
232 pattern format output breaks
236 p'%'p0.0 0.573 p%p0,6
237 %@@@@ 0.0326 %3,260 K
238 %#,@@@ 15.43 %1\u202f540 K
239 // JDK does not support rounding increments
240 %#,##4.1 16.55 %1\u202f656,4 K
241 // JDK gives %16,255E3
242 %##0.00E0 162.55 %16,3E3 K
247 pattern format output breaks
248 0.0\u2030 0.573 573,0‰
249 \u20300.0 0.573 \u2030573,0
250 p\u2030p0.0 0.573 p\u2030p573,0
251 p'\u2030'p0.0 0.573 p\u2030p0,6
252 \u2030@@@@ 0.0326 \u203032,60 K
253 \u2030#,@@@ 15.43 \u203015\u202f400 K
254 \u2030#,##4.1 16.55 \u203016\u202f551,7 K
255 // JDK gives \u2030162,55E3
256 \u2030##0.00E0 162.55 \u2030163E3 K
261 pattern format output breaks
262 // JDK does not seem to support padding
263 $**####,##0 1234 $***1\u202f234 K
264 *x$####,##0 1234 xxx$1\u202f234 K
265 ####,##0*x$ 1234 1\u202f234xxx$ K
266 ####,##0$*x 1234 1\u202f234$xxx K
267 // JDK doesn't seem to handle suffixes correctly dropping the 'nx' entirely
268 ####,##0$*x;ne#n -1234 ne1\u202f234nx K
269 ####,##0$*x;n#'*' -1234 n1\u202f234*xx K
270 *y%4.2###### 4.33 yyyy%432,6 K
271 // In J ICU adds padding as if 'EUR' is only 2 chars (2 * 0xa4)
272 \u00a4\u00a4 **####0.00 433.0 EUR *433,00 K
273 // P fails this one because the test code bypasses CurrencyUsage
274 \u00a4\u00a4 **#######0 433.0 EUR *433,00 KP
276 test padding and currencies
278 locale currency pattern format output breaks
279 // In J, JPY is considered 2 char (2 * 0xa4) even though padding is done
280 // after prefix. In C this test works.
281 fr JPY \u00a4\u00a4 **#######0 433.22 JPY ****433 K
282 // JDK doesn't correct rounding for currency, shows USD (433
283 en USD \u00a4\u00a4 **#######0;\u00a4\u00a4 (#) -433.22 USD (433.22) K
289 pattern currency output breaks
290 // JDK gives shows EUR instead of the euro symbol in this case
291 #,##0.00 \u00a4 EUR 1\u202f234,57 \u20ac K
292 // JDK gives 1\u00A0234,57. JDK doesn't seem to correct rounding
293 // based on currency.
294 #,##0.00 \u00a4 JPY 1\u202f235 JPY K
296 test prefixes and suffixes
298 set pattern 0.00+;(#)
302 // JDK does not support negative suffixes
305 test minimum grouping digits
308 set minGroupingDigits 2
316 test min max fraction digits
318 set pattern #,##0.###
321 minFractionDigits maxFractionDigits output
326 test min max integer digits
328 set pattern #,##0.###
331 minIntegerDigits maxIntegerDigits output
336 test min max fraction digits scientific
339 set format 299792458.0
341 minIntegerDigits maxIntegerDigits minFractionDigits maxFractionDigits output breaks
342 // JDK gives 2.99792458E8 (maxInt + maxFrac instead of minInt + maxFrac)
344 // JDK gives .3E9 instead of unlimited precision.
345 0 1 0 0 2.99792458E8 K
347 // JDK gives E0 instead of allowing for unlimited precision
348 0 0 0 0 2.99792458E8 K
352 0 3 0 0 299.792458E6 K
353 // JDK gives 299.8E6 (maybe maxInt + maxFrac instead of minInt + maxFrac)?
355 // JDK gives 299.7925E6
357 // JDK gives 299.79246E6
365 0 0 1 0 2.99792458E8 K
368 // According to the spec, if maxInt>minInt and minInt>1, then set
370 2 8 1 6 2.9979246E8 K
371 // Treat max int digits > 8 as being the same as min int digits.
372 // This behavior is not spelled out in the specification.
373 // JDK fails here because it tries to use 9 + 6 = 15 sig digits.
374 2 9 1 6 29.979246E7 K
379 pattern format output breaks
381 #00.0##E0 1.2 1.2E0 K
385 test significant digits scientific
388 set format 290000000.0
390 minSigDigits maxSigDigits output breaks
402 test min max fraction digits scientific 2
405 set format 29979245.0
407 minIntegerDigits maxIntegerDigits minFractionDigits maxFractionDigits output breaks
409 0 0 0 0 2.9979245E7 K
411 0 1 0 0 2.9979245E7 K
413 0 4 0 0 2997.9245E4 K
417 set pattern #,##0.###
419 format maxIntegerDigits output breaks
421 // C obeys maxIntegerDigits and prints after the decimal place
423 // CJP ignore max integer if it is less than zero and prints "123"
424 123 -2147483648 0 CJP
426 12345 -2147483648 0 CJP
428 5.3 -2147483648 .3 CJP
430 test patterns with zero
434 pattern output breaks
445 test significant digits manually set
456 0.0012345 0.0012345 K
457 0.00123456 0.0012346 K
464 test grouping used setters
474 test grouping used setters in parsing
477 locale useGrouping parse output breaks
478 en_US 1 123,456 123456
480 en_US 1 123.456 123.456
481 en_US 0 123.456 123.456
482 it_IT 1 123,456 123.456
483 it_IT 0 123,456 123.456
484 it_IT 1 123.456 123456
487 test no grouping in pattern with parsing
490 locale parse output breaks
492 en_US 123.456 123.456
493 fr_FR 123,456 123.456
496 test grouping setters
502 output grouping grouping2 breaks
506 test grouping setters with min grouping digits
512 output grouping grouping2 minGroupingDigits breaks
517 test multiplier setters
520 format multiplier output breaks
523 // J (current ICU4J) throws exception on zero multiplier.
525 // Q multiplies by zero and prints 0.
532 test rounding setters
535 set roundingIncrement 0.25
540 // P doesn't support mixing minFrac with roundingIncrement (prints 0.50).
550 padCharacter formatWidth output breaks
555 test use scientific setter
560 output useScientific breaks
565 test rounding mode setters
569 format roundingMode output breaks
582 test currency usage setters
584 set pattern \u00a4\u00a4 0
586 format currency currencyUsage output breaks
587 0.37 CHF standard CHF 0.37 K
588 0.37 CHF cash CHF 0.35 K
589 1.234 CZK standard CZK 1.23 K
592 test currency usage to pattern
595 currency currencyUsage toPattern breaks
596 // These work in J, but it prepends an extra hash sign to the pattern.
597 // K does not support this feature.
605 test currency rounding
609 pattern format output breaks
611 // Currency rounding should always override the pattern.
612 // K prints the currency in ISO format for some reason.
613 \u00a4# 123 $123.00 K
614 \u00a4#.000 123 $123.00 K
615 \u00a4#.## 123 $123.00 K
617 test exponent parameter setters
622 decimalSeparatorAlwaysShown exponentSignAlwaysShown minimumExponentDigits output breaks
625 // decimalSeparatorAlwaysShown K=JDK; C=ICU4C; J=ICU4J
632 test exponent decimalSeparatorAlwaysShown default
636 format output decimalSeparatorAlwaysShown breaks
637 // decimalSeparatorAlwaysShown off by default
642 test pad position setters
644 set pattern **[#####0.##];((#))
646 format padPosition output breaks
647 12.34 beforePrefix ****[12.34] K
648 12.34 afterPrefix [****12.34] K
649 12.34 beforeSuffix [12.34****] K
650 12.34 afterSuffix [12.34]**** K
651 -12.34 beforePrefix **((12.34)) K
652 -12.34 afterPrefix ((**12.34)) K
653 -12.34 beforeSuffix ((12.34**)) K
654 -12.34 afterSuffix ((12.34))** K
661 format positivePrefix positiveSuffix negativePrefix negativeSuffix output
663 12.34 \u00a4\u00a4 12,34\u00a4\u00a4
666 -12.34 \u00a4 \u00a412,34
671 test more affix setters
675 format positivePrefix negativePrefix output
676 0.648 booya cooya booya64,80
678 test nan and infinity
680 set pattern [0.00];(#)
685 // J does not print the affixes
689 test nan and infinity with multiplication
698 test nan and infinity with padding
703 format padPosition output breaks
704 Inf beforePrefix $$$\u221e$ K
705 Inf afterPrefix $$$ \u221e$ K
706 Inf beforeSuffix $$$\u221e $ K
707 Inf afterSuffix $$$\u221e$ K
708 // J does not print the affixes
710 NaN beforePrefix $$$NaN$ K
711 NaN afterPrefix $$$ NaN$ K
712 NaN beforeSuffix $$$NaN $ K
713 NaN afterSuffix $$$NaN$ K
715 test apply formerly localized patterns
717 // documentation says localizedPattern is not supported, change to pattern
718 locale pattern format output breaks
720 // This next test breaks JDK. JDK doesn't multiply by 100.
721 fa \u0025\u00a0\u0023\u0030 0.4376 \u066a\u00a0\u06f4\u06f4 K
723 test localized pattern basic symbol coverage
725 locale localizedPattern toPattern breaks
727 // JDK either doesn't know sl uses this character for minus sign
728 // or doesn't support minus sign in localized pattern
729 sl #.##0;#.##0− #,##0;#,##0- K
730 // JDK does not have data for "×10^" in this locale
731 en_SE 0,00×10^0;0,00×10^0- 0.00E0;0.00E0- K
732 // JDK does not seem to transform the digits in localized patterns
733 ar_SA #\u066C##\u0660\u066B\u0660\u0660;a# #,##0.00;a#,##0.00 K
738 pattern toPattern breaks
739 // All of the C and S failures in this section are because of functionally equivalent patterns
740 // JDK doesn't support any patterns with padding or both negative prefix and suffix
742 **##0,000 **##0,000 K
743 **###0,000 **###0,000 K
744 **####0,000 **#,##0,000 CJKP
749 000,000 #,000,000 CJP
753 // No secondary grouping in JDK
754 #,##,###.02500 #,##,###.02500 K
755 pp#,000;(#) pp#,000;(#,000) K
756 **####,##,##0.0##;(#) **#,##,##,##0.0##;**(##,##,##0.0##) CJKP
757 // No significant digits in JDK
761 // The following one works in JDK, probably because
762 // it just returns the same string
764 ###0.00#E0 ###0.00#E0
765 ##00.00#E0 ##00.00#E0
768 ###0.00#E00 ###0.00#E00
772 set pattern +#,##0.0###;(#)
783 // S is successful at parsing this as -5347.25 in lenient mode
787 // JDK stops parsing at the spaces. JDK doesn't see space as a grouping separator
790 // Trailing grouping separators are not OK.
791 // C/J/P stop at the offending separator.
792 (34,,25,E-1) fail CJKP
795 (34,,25 E-1) -342.5 K
796 // Spaces are not allowed after exponent symbol
797 // C parses up to the E
800 +1,234,567.8901 1234567.8901
801 +1,23,4567.8901 1234567.8901
802 // Fraction grouping is disabled by default
803 +1,23,4567.89,01 1234567.89
804 +1,23,456.78.9 123456.78
809 // Parsing stops at comma as it is different from other separators
815 // Whitespace immediately after prefix doesn't count as digit separator in C
816 + ,79,,20,33 792033 K
818 // C allows trailing separators when there is a prefix and suffix.
821 // C parses to the spaces
825 // C will parse up to the letter.
831 // 2nd decimal points are ignored
836 set pattern #,##0.0###+;#-
839 // J and K just bail.
842 // J bails; K sees -34
844 // JDK sees this as -1234 for some reason
847 // C and P bail because of trailing separators
855 set pattern +#,##,##0.0###;(#)
857 set minGroupingDigits 2
862 // separators in wrong place cause failure, no separators ok.
865 (65,347.25) -65347.25
866 // JDK does allow separators in the wrong place and parses as -5347.25
868 // strict requires prefix or suffix, except in C
873 // Strict doesn't allow separators in sci notation.
876 // Both prefix and suffix needed for strict.
877 // JDK accepts this and parses as -342.5
880 +12,34,567.8901 1234567.8901
881 // With strict digit separators don't have to be the right type
882 // JDK doesn't acknowledge space as a separator
883 +12 34 567.8901 1234567.8901 K
884 // In general the grouping separators have to match their expected
885 // location exactly. The only exception is when string being parsed
886 // have no separators at all.
888 // JDK doesn't require separators to be in the right place.
889 +1,23,4567.8901 fail K
890 +1,234,567.8901 fail K
891 +1234,567.8901 fail K
892 +1,234567.8901 fail K
893 +1234567.8901 1234567.8901
894 // Minimum grouping is not satisfied below, but that's ok
895 // because minimum grouping is optional.
897 // Comma after decimal means parse to a comma
898 +1,23,456.78,9 123456.78
899 +1,23,456.78.9 123456.78
903 // JDK parses as -1945
906 test parse strict scientific
907 // See #13737: Old behavior should be retained in this case
918 test parse strict without prefix/suffix
926 // The following case passes only when setSignAlwaysShown is enabled
930 test parse integer only
933 set parseIntegerOnly 1
942 test parse no exponent flag
946 parseNoExponent parse output breaks
947 // JDK doesn't allow lowercase exponent but ICU4J and ICU4C do.
954 test parse currency fail
958 parse output outputCurrency breaks
959 // Fixed in ticket 11735
962 test parse strange prefix
964 set positivePrefix dd
965 set negativePrefix ddd
971 test parse strange suffix
973 set positiveSuffix dd
975 set negativeSuffix ddd
981 test really strange suffix
983 set positiveSuffix 9K
985 set negativeSuffix 9N
988 // A non-greedy parse is required to pass these cases.
989 // All of the implementations being tested are greedy.
993 test really strange prefix
995 set positivePrefix 82
996 set negativePrefix 28
1002 test parse pattern with quotes
1009 test parse with locale symbols
1010 // The grouping separator in it_CH is an apostrophe
1021 test parse with European-style comma/period
1030 987.654,321 987654.321
1035 format pattern plural
1050 test parse currency ISO
1051 set pattern 0.00 \u00a4\u00a4;(#) \u00a4\u00a4
1054 parse output outputCurrency breaks
1063 (7.92) USD -7.92 USD
1064 (7.92) GBP -7.92 GBP
1065 (7.926) USD -7.926 USD
1066 (7.926 USD) -7.926 USD
1067 (USD 7.926) -7.926 USD
1068 USD (7.926) -7.926 USD
1069 USD (7.92) -7.92 USD
1076 US Dollars 53.45 53.45 USD
1077 53.45 US Dollars 53.45 USD
1078 US Dollar 53.45 53.45 USD
1079 53.45 US Dollar 53.45 USD
1080 US Dollars53.45 53.45 USD
1081 53.45US Dollars 53.45 USD
1082 US Dollar53.45 53.45 USD
1083 US Dollat53.45 fail USD
1084 53.45US Dollar 53.45 USD
1085 US Dollars (53.45) -53.45 USD
1086 (53.45) US Dollars -53.45 USD
1087 (53.45) Euros -53.45 EUR
1088 US Dollar (53.45) -53.45 USD
1089 (53.45) US Dollar -53.45 USD
1090 US Dollars(53.45) -53.45 USD
1091 (53.45)US Dollars -53.45 USD
1092 US Dollar(53.45) -53.45 USD
1093 US Dollat(53.45) fail USD
1094 (53.45)US Dollar -53.45 USD
1097 test parse currency ISO negative
1098 set pattern 0.00 \u00a4\u00a4;-# \u00a4\u00a4
1101 parse output outputCurrency breaks
1112 -7.926 USD -7.926 USD
1113 USD -7.926 -7.926 USD
1119 US Dollars 53.45 53.45 USD
1120 53.45 US Dollars 53.45 USD
1121 US Dollar 53.45 53.45 USD
1122 53.45 US Dollar 53.45 USD
1123 US Dollars53.45 53.45 USD
1124 53.45US Dollars 53.45 USD
1125 US Dollar53.45 53.45 USD
1126 US Dollat53.45 fail USD
1127 53.45US Dollar 53.45 USD
1130 test parse currency long
1131 set pattern 0.00 \u00a4\u00a4\u00a4;(#) \u00a4\u00a4\u00a4
1134 parse output outputCurrency breaks
1143 (7.92) USD -7.92 USD
1144 (7.92) GBP -7.92 GBP
1145 (7.926) USD -7.926 USD
1146 (7.926 USD) -7.926 USD
1147 (USD 7.926) -7.926 USD
1148 USD (7.926) -7.926 USD
1149 USD (7.92) -7.92 USD
1156 US Dollars 53.45 53.45 USD
1157 53.45 US Dollars 53.45 USD
1158 US Dollar 53.45 53.45 USD
1159 53.45 US Dollar 53.45 USD
1160 US Dollars53.45 53.45 USD
1161 53.45US Dollars 53.45 USD
1162 US Dollar53.45 53.45 USD
1163 US Dollat53.45 fail USD
1164 53.45US Dollar 53.45 USD
1167 test parse currency short
1168 set pattern 0.00 \u00a4;(#) \u00a4
1171 parse output outputCurrency breaks
1180 (7.92) USD -7.92 USD
1181 (7.92) GBP -7.92 GBP
1182 (7.926) USD -7.926 USD
1183 (7.926 USD) -7.926 USD
1184 (USD 7.926) -7.926 USD
1185 USD (7.926) -7.926 USD
1186 USD (7.92) -7.92 USD
1193 US Dollars 53.45 53.45 USD
1194 53.45 US Dollars 53.45 USD
1195 US Dollar 53.45 53.45 USD
1196 53.45 US Dollar 53.45 USD
1197 US Dollars53.45 53.45 USD
1198 53.45US Dollars 53.45 USD
1199 US Dollar53.45 53.45 USD
1200 US Dollat53.45 fail USD
1201 53.45US Dollar 53.45 USD
1204 test parse currency short prefix
1205 set pattern \u00a40.00;(\u00a4#)
1208 parse output outputCurrency breaks
1217 // C and P fail these because '(' is an incomplete prefix.
1218 (7.92) USD -7.92 USD CJP
1219 (7.92) GBP -7.92 GBP CJP
1220 (7.926) USD -7.926 USD CJP
1221 (7.926 USD) -7.926 USD CJP
1222 (USD 7.926) -7.926 USD
1223 USD (7.926) -7.926 USD CJP
1224 USD (7.92) -7.92 USD CJP
1225 (7.92)USD -7.92 USD CJP
1226 USD(7.92) -7.92 USD CJP
1231 US Dollars 53.45 53.45 USD
1232 53.45 US Dollars 53.45 USD
1233 US Dollar 53.45 53.45 USD
1234 53.45 US Dollar 53.45 USD
1235 US Dollars53.45 53.45 USD
1236 53.45US Dollars 53.45 USD
1237 US Dollar53.45 53.45 USD
1238 53.45US Dollar 53.45 USD
1240 test format foreign currency
1244 pattern format output breaks
1245 \u00a4\u00a4\u00a4 0.00;\u00a4\u00a4\u00a4 # 1235 \u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 \u06F1\u06F2\u06F3\u06F5 K
1246 \u00a4\u00a4 0.00;\u00a4\u00a4 -# 1235 IRR \u06F1\u06F2\u06F3\u06F5 K
1247 \u00a4 0.00;\u00a4 -# 1235 \u0631\u06cc\u0627\u0644 \u06F1\u06F2\u06F3\u06F5 K
1249 test parse foreign currency symbol
1250 set pattern \u00a4 0.00;\u00a4 -#
1253 parse output outputCurrency breaks
1254 \u0631\u06cc\u0627\u0644 \u06F1\u06F2\u06F3\u06F5 1235 IRR
1255 IRR \u06F1\u06F2\u06F3\u06F5 1235 IRR
1256 // P fails here because this currency name is in the Trie only, but it has the same prefix as the non-Trie currency
1257 \u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 \u06F1\u06F2\u06F3\u06F5 1235 IRR CJP
1259 \u0631\u06cc\u0627\u0644 1235 1235 IRR
1260 \u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 1235 1235 IRR CJP
1262 test parse foreign currency ISO
1263 set pattern \u00a4\u00a4 0.00;\u00a4\u00a4 -#
1266 parse output outputCurrency breaks
1267 \u0631\u06cc\u0627\u0644 \u06F1\u06F2\u06F3\u06F5 1235 IRR
1268 IRR \u06F1\u06F2\u06F3\u06F5 1235 IRR
1269 \u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 \u06F1\u06F2\u06F3\u06F5 1235 IRR CJP
1271 \u0631\u06cc\u0627\u0644 1235 1235 IRR
1272 \u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 1235 1235 IRR CJP
1274 test parse foreign currency full
1275 set pattern \u00a4\u00a4\u00a4 0.00;\u00a4\u00a4\u00a4 -#
1278 parse output outputCurrency breaks
1279 \u0631\u06cc\u0627\u0644 \u06F1\u06F2\u06F3\u06F5 1235 IRR
1280 IRR \u06F1\u06F2\u06F3\u06F5 1235 IRR
1281 \u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 \u06F1\u06F2\u06F3\u06F5 1235 IRR CJP
1283 \u0631\u06cc\u0627\u0644 1235 1235 IRR
1284 \u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 1235 1235 IRR CJP
1286 test parse currency with foreign symbols symbol english
1287 set pattern \u00a4 0.00;\u00a4 (#)
1290 parse output outputCurrency
1292 \u20ac 7.82 7.82 EUR
1296 test parse currency with foreign symbols ISO english
1297 set pattern \u00a4\u00a4 0.00;\u00a4\u00a4 (#)
1300 parse output outputCurrency
1302 \u20ac 7.82 7.82 EUR
1306 test parse currency with foreign symbols full english
1307 set pattern \u00a4\u00a4\u00a4 0.00;\u00a4\u00a4\u00a4 (#)
1310 parse output outputCurrency
1312 \u20ac 7.82 7.82 EUR
1316 test parse currency without currency mode
1317 // Should accept a symbol associated with the currency specified by the API,
1318 // but should not traverse the full currency data.
1320 set pattern \u00a4#,##0.00
1322 parse currency output breaks
1324 USD52.41 USD 52.41 K
1325 \u20ac52.41 USD fail
1329 \u20ac52.41 EUR 52.41 K
1332 test parse currency ISO strict
1333 set pattern 0.00 \u00a4\u00a4;(#) \u00a4\u00a4
1337 parse output outputCurrency breaks
1338 $53.45 53.45 USD CJP
1342 USD53.45 53.45 USD CJP
1343 (7.92) USD -7.92 USD
1344 (7.92) EUR -7.92 EUR
1345 (7.926) USD -7.926 USD
1346 (7.926 USD) fail USD
1347 (USD 7.926) fail USD
1348 USD (7.926) fail USD
1356 US Dollars 53.45 fail USD
1357 53.45 US Dollars 53.45 USD
1358 US Dollar 53.45 fail USD
1359 53.45 US Dollar 53.45 USD
1360 US Dollars53.45 53.45 USD CJP
1361 53.45US Dollars fail USD
1362 US Dollar53.45 53.45 USD CJP
1363 US Dollat53.45 fail USD
1364 53.45US Dollar fail USD
1365 US Dollars (53.45) fail USD
1366 (53.45) US Dollars -53.45 USD
1367 US Dollar (53.45) fail USD
1368 (53.45) US Dollar -53.45 USD
1369 US Dollars(53.45) fail USD
1370 (53.45)US Dollars fail USD
1371 US Dollar(53.45) fail USD
1372 US Dollat(53.45) fail USD
1373 (53.45)US Dollar fail USD
1377 set roundingMode ceiling
1378 set minFractionDigits 0
1379 set maxFractionDigits 0
1381 format output breaks
1384 test parse decimalPatternMatchRequired
1386 set decimalPatternMatchRequired 1
1388 pattern parse output breaks
1389 // K doesn't support this feature.
1403 test parse minus sign
1407 pattern parse output breaks
1417 test parse case sensitive
1422 parse parseCaseSensitive output breaks
1426 // K does not support case-insensitive parsing for prefix/suffix.
1439 test parse infinity and scientific notation overflow
1446 1E999999999999999 Inf K
1447 -1E999999999999999 -Inf K
1448 1E-99999999999999 0.0
1449 // Note: The test suite code doesn't properly check for 0.0 vs. -0.0
1450 -1E-99999999999999 -0.0
1453 // J and K get Infinity
1454 1E2147483646 1E+2147483646 JK
1457 // K returns zero here
1458 1E-2147483647 1E-2147483647 JK
1459 1E-2147483646 1E-2147483646 JK
1461 test format push limits
1463 set minFractionDigits 2
1464 set roundingMode halfDown
1466 maxFractionDigits format output breaks
1467 100 987654321987654321 987654321987654321.00
1468 100 987654321.987654321 987654321.987654321
1469 100 9999999999999.9950000000001 9999999999999.9950000000001
1470 2 9999999999999.9950000000001 10000000000000.00
1471 2 9999999.99499999 9999999.99
1472 // K doesn't support halfDown rounding mode?
1473 2 9999999.995 9999999.99 K
1474 2 9999999.99500001 10000000.00
1475 100 56565656565656565656565656565656565656565656565656565656565656 56565656565656565656565656565656565656565656565656565656565656.00
1476 100 454545454545454545454545454545.454545454545454545454545454545 454545454545454545454545454545.454545454545454545454545454545
1477 100 0.0000000000000000000123 0.0000000000000000000123
1478 100 -78787878787878787878787878787878 -78787878787878787878787878787878.00
1479 100 -8989898989898989898989.8989898989898989 -8989898989898989898989.8989898989898989
1484 pattern lenient parse output breaks
1485 // Groups after the first group need 2 digits to be accepted.
1486 // JDK does not see space as grouping and parses most of these as 9.
1489 #,##0 1 9 999 9999 K
1505 #,##0 0 9 999 9999 K
1506 #,##0 0 9 9 9 fail K
1508 #,##0 0 99,.0 fail K
1510 #,##0 0 9 99. fail K
1520 test more strict grouping parse
1522 set pattern #,##,##0
1524 lenient parse output breaks
1529 test parse ignorables
1531 // Note: Prefixes contain RLMs, as do some of the test cases.
1532 set pattern x ab0c df
1533 set negativePrefix y gh
1534 set negativeSuffix i jk
1558 // S stops parsing after the 'i' for these and returns -56
1559 // C stops before the 'i' and gets 56
1567 // S and C get 56 (accepts ' ' gs grouping); K gets null
1571 test parse spaces in grouping
1572 // This test gives the ideal behavior of these cases, which
1573 // none of the implementations currently support.
1574 // Similar to the test above for ticket #11230
1581 // K gets 1 here; doesn't pick up the grouping separator
1584 test rounding increment significant digits
1585 // This test is for #13111
1591 format output breaks
1594 // K gets "1.1" (??)
1597 test lenient parse currency match
1598 // This test is for #13112
1600 set pattern ¤#,##0.00
1606 test percentage parsing multiplier
1607 // This test is for #13114
1614 // C and P scale by 100 even if the percent sign is not present
1617 test trailing grouping separators in pattern
1618 // This test is for #13115
1621 pattern format output breaks
1623 // The following patterns are rejected as malformed.
1627 test empty negative subpattern
1628 // This test is for #13117
1631 pattern format output breaks
1634 // K still prepends a '-' even though the pattern says otherwise
1637 test percentage multiplier parsing
1638 // This test is for #13129
1643 9223372036854775807% 92233720368547758.07 K
1645 test sign always shown
1648 set signAlwaysShown 1
1650 format output breaks
1651 // K does not support this feature
1656 test parse strict with plus sign
1659 set signAlwaysShown 1
1661 lenient parse output breaks
1673 test parse with scientific-separator-affix overlap
1676 pattern lenient parse output breaks
1677 0E0','x 1 5E3,x 5000
1678 0E0','x 0 5E3,x 5000
1679 0E0'.'x 1 5E3.x 5000
1680 0E0'.'x 0 5E3.x 5000
1682 test parse() lowercase currency
1694 // US$ is not used for US dollars in en-US
1698 123 US dollars 123 K
1699 123 US DOLLARS 123 K
1700 123 us dollars 123 K
1701 // Foreign currencies are not accepted in .parse()
1704 British pounds 123 fail
1705 british POUNDS 123 fail
1707 test parseCurrency() lowercase currency
1712 parse output outputCurrency breaks
1722 123 US dollars 123 USD
1723 123 US DOLLARS 123 USD
1724 123 us dollars 123 USD
1727 British pounds 123 123 GBP
1728 british POUNDS 123 123 GBP
1730 test parse scientific with bidi marks
1732 locale parse output breaks
1733 en 4E\u200E+02 400 K
1735 he 4E\u200E+02 400 K