// C obeys maxIntegerDigits and prints after the decimal place
0 0 .0 HKQ
// C and Q ignore max integer if it is less than zero and prints "123"
-123 -2147483648 0 CQ
+123 -2147483648 0 CJQ
12345 1 5
-12345 -2147483648 0 CQ
+12345 -2147483648 0 CJQ
5.3 1 5.3
-5.3 -2147483648 .3 CQ
+5.3 -2147483648 .3 CJQ
test patterns with zero
set locale en
format multiplier output breaks
23 -12 -276
23 -1 -23
-// H (ICU4J 58) throws exception on zero multiplier.
+// H (ICU4J 58) and J (current ICU4J) throw exception on zero multiplier.
// ICU4C prints 23.
// Q multiplies by zero and prints 0.
-23 0 0 CH
+23 0 0 CHJ
23 1 23
23 12 276
-23 12 -276
-0.35 -0.25 K
0.35 0.25 K
// Q doesn't support mixing minFrac with roundingIncrement (prints 0.50).
-0.39 0.5 KQ
-0.62 0.5 KQ
+0.39 0.5 JKQ
+0.62 0.5 JKQ
0.63 0.75 K
test padding setters
**0,000 **0,000 HK
**##0,000 **##0,000 K
**###0,000 **###0,000 K
-**####0,000 **#,##0,000 CKS
+**####0,000 **#,##0,000 CJKS
###,000. #,000.
-0,000 #0,000 CS
+0,000 #0,000 CJS
.00 #.00
-000 #000 CS
-000,000 #,000,000 CS
+000 #000 CJS
+000,000 #,000,000 CJS
pp#,000 pp#,000
-00.## #00.## CS
+00.## #00.## CJS
#,#00.025 #,#00.025
// No secondary grouping in JDK
#,##,###.02500 #,##,###.02500 K
pp#,000;(#) pp#,000;(#,000) K
-**####,##,##0.0##;(#) **#,##,##,##0.0##;**(##,##,##0.0##) CKS
+**####,##,##0.0##;(#) **#,##,##,##0.0##;**(##,##,##0.0##) CJKS
// No significant digits in JDK
@@### @@### K
@,@#,### @,@#,### K
(34 25E-1) -342.5 K
(34,,25E-1) -342.5
// H doesn't allow trailing separators before E but C and P do
-(34,,25,E-1) -342.5 CHP
+(34,,25,E-1) -342.5 CHJP
(34 25 E-1) -342.5 HK
(34,,25 E-1) -342.5 HK
// Spaces are not allowed after exponent symbol
1,234,,,+ 1234 HK
1,234- -1234
// H, C, and P bail because of trailing separators
-1,234,- -1234 CHP
+1,234,- -1234 CHJP
// J bails here too
1234 - -1234 H
set negativeSuffix 9N
begin
parse output breaks
-// S is the only implementation that passes these cases.
-// C and P consume the '9' as a digit and assumes number is negative
-// H and JDK bail
-6549K 654 CHKP
-// C and P consume the '9' as a digit and assumes number is negative
-// H and JDK bail
-6549N -654 CHKP
+// A non-greedy parse is required to pass these cases.
+// All of the implementations being tested are greedy.
+6549K 654 CHJKP
+6549N -654 CHJKP
test really strange prefix
set locale en
parse output outputCurrency breaks
53.45 fail GBP
£53.45 53.45 GBP
-$53.45 fail USD HP
+$53.45 fail USD HJP
53.45 USD 53.45 USD
53.45 GBP 53.45 GBP
USD 53.45 53.45 USD H
(8) USD -8 USD
-8 USD -8 USD
67 USD 67 USD
-53.45$ fail USD P
+53.45$ fail USD JP
US Dollars 53.45 53.45 USD H
53.45 US Dollars 53.45 USD
US Dollar 53.45 53.45 USD H
parse output outputCurrency breaks
53.45 fail GBP
£53.45 53.45 GBP
-$53.45 fail USD HP
+$53.45 fail USD HJP
53.45 USD 53.45 USD
53.45 GBP 53.45 GBP
USD 53.45 53.45 USD H
USD-7.92 -7.92 USD H
-8 USD -8 USD
67 USD 67 USD
-53.45$ fail USD P
+53.45$ fail USD JP
US Dollars 53.45 53.45 USD H
53.45 US Dollars 53.45 USD
US Dollar 53.45 53.45 USD H
// J throws a NullPointerException on the first case
53.45 fail GBP
£53.45 53.45 GBP
-$53.45 fail USD HP
+$53.45 fail USD HJP
53.45 USD 53.45 USD
53.45 GBP 53.45 GBP
USD 53.45 53.45 USD H
-8 USD -8 USD
67 USD 67 USD
// J throws a NullPointerException on the next case
-53.45$ fail USD P
+53.45$ fail USD JP
US Dollars 53.45 53.45 USD H
53.45 US Dollars 53.45 USD
US Dollar 53.45 53.45 USD H
parse output outputCurrency breaks
53.45 fail GBP
£53.45 53.45 GBP
-$53.45 fail USD HP
+$53.45 fail USD HJP
53.45 USD 53.45 USD
53.45 GBP 53.45 GBP
USD 53.45 53.45 USD H
(8) USD -8 USD
-8 USD -8 USD
67 USD 67 USD
-53.45$ fail USD P
+53.45$ fail USD JP
US Dollars 53.45 53.45 USD H
53.45 US Dollars 53.45 USD
US Dollar 53.45 53.45 USD H
parse output outputCurrency breaks
53.45 fail GBP
£53.45 53.45 GBP
-$53.45 fail USD HP
+$53.45 fail USD HJP
53.45 USD 53.45 USD
53.45 GBP 53.45 GBP
USD 53.45 53.45 USD H
53.45USD 53.45 USD H
USD53.45 53.45 USD
// C and P fail these because '(' is an incomplete prefix.
-(7.92) USD -7.92 USD CHP
-(7.92) GBP -7.92 GBP CHP
-(7.926) USD -7.926 USD CHP
-(7.926 USD) -7.926 USD CHP
+(7.92) USD -7.92 USD CHJP
+(7.92) GBP -7.92 GBP CHJP
+(7.926) USD -7.926 USD CHJP
+(7.926 USD) -7.926 USD CHJP
(USD 7.926) -7.926 USD H
-USD (7.926) -7.926 USD CHP
-USD (7.92) -7.92 USD CHP
-(7.92)USD -7.92 USD CHP
-USD(7.92) -7.92 USD CHP
-(8) USD -8 USD CHP
+USD (7.926) -7.926 USD CHJP
+USD (7.92) -7.92 USD CHJP
+(7.92)USD -7.92 USD CHJP
+USD(7.92) -7.92 USD CHJP
+(8) USD -8 USD CHJP
-8 USD -8 USD
67 USD 67 USD
-53.45$ fail USD P
+53.45$ fail USD JP
US Dollars 53.45 53.45 USD H
53.45 US Dollars 53.45 USD
US Dollar 53.45 53.45 USD H
\u0631\u06cc\u0627\u0644 \u06F1\u06F2\u06F3\u06F5 1235 IRR
IRR \u06F1\u06F2\u06F3\u06F5 1235 IRR
// P fails here because this currency name is in the Trie only, but it has the same prefix as the non-Trie currency
-\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 \u06F1\u06F2\u06F3\u06F5 1235 IRR CP
+\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 \u06F1\u06F2\u06F3\u06F5 1235 IRR CJP
IRR 1235 1235 IRR
\u0631\u06cc\u0627\u0644 1235 1235 IRR
-\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 1235 1235 IRR CP
+\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 1235 1235 IRR CJP
test parse foreign currency ISO
set pattern \u00a4\u00a4 0.00;\u00a4\u00a4 -#
parse output outputCurrency breaks
\u0631\u06cc\u0627\u0644 \u06F1\u06F2\u06F3\u06F5 1235 IRR
IRR \u06F1\u06F2\u06F3\u06F5 1235 IRR
-\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 \u06F1\u06F2\u06F3\u06F5 1235 IRR CP
+\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 \u06F1\u06F2\u06F3\u06F5 1235 IRR CJP
IRR 1235 1235 IRR
\u0631\u06cc\u0627\u0644 1235 1235 IRR
-\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 1235 1235 IRR CP
+\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 1235 1235 IRR CJP
test parse foreign currency full
set pattern \u00a4\u00a4\u00a4 0.00;\u00a4\u00a4\u00a4 -#
parse output outputCurrency breaks
\u0631\u06cc\u0627\u0644 \u06F1\u06F2\u06F3\u06F5 1235 IRR
IRR \u06F1\u06F2\u06F3\u06F5 1235 IRR
-\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 \u06F1\u06F2\u06F3\u06F5 1235 IRR CP
+\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 \u06F1\u06F2\u06F3\u06F5 1235 IRR CJP
IRR 1235 1235 IRR
\u0631\u06cc\u0627\u0644 1235 1235 IRR
-\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 1235 1235 IRR CP
+\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 1235 1235 IRR CJP
test parse currency with foreign symbols symbol english
set pattern \u00a4 0.00;\u00a4 (#)
parse currency output breaks
$52.41 USD 52.41
USD52.41 USD 52.41 K
-\u20ac52.41 USD fail CP
-EUR52.41 USD fail CP
-$52.41 EUR fail CP
-USD52.41 EUR fail CP
+\u20ac52.41 USD fail CJP
+EUR52.41 USD fail CJP
+$52.41 EUR fail CJP
+USD52.41 EUR fail CJP
\u20ac52.41 EUR 52.41 K
EUR52.41 EUR 52.41
set lenient 0
begin
parse output outputCurrency breaks
-$53.45 53.45 USD CP
+$53.45 53.45 USD CJP
53.45 USD 53.45 USD
USD 53.45 fail USD
53.45USD fail USD
-USD53.45 53.45 USD CP
+USD53.45 53.45 USD CJP
(7.92) USD -7.92 USD
(7.92) EUR -7.92 EUR
(7.926) USD -7.926 USD
53.45 US Dollars 53.45 USD
US Dollar 53.45 fail USD
53.45 US Dollar 53.45 USD
-US Dollars53.45 53.45 USD CP
+US Dollars53.45 53.45 USD CJP
53.45US Dollars fail USD
-US Dollar53.45 53.45 USD CP
+US Dollar53.45 53.45 USD CJP
US Dollat53.45 fail USD
53.45US Dollar fail USD
US Dollars (53.45) fail USD
-1E-99999999999999 -0.0
1E2147483648 Inf K
1E2147483647 Inf K
-// H and K get Infinity
-1E2147483646 1E+2147483646 HK
+// H, J and K get Infinity
+1E2147483646 1E+2147483646 HJK
1E-2147483649 0
1E-2147483648 0
// H, K, C and P return zero here
-1E-2147483647 1E-2147483647 CHKP
-1E-2147483646 1E-2147483646 HK
+1E-2147483647 1E-2147483647 CHJKP
+1E-2147483646 1E-2147483646 HJK
test format push limits
set locale en
56i jk -56 HK
56i jk -56 HK
// S and C get 56 (accepts ' ' gs grouping); H and K get null
-5 6 fail CP
+5 6 fail CJP
56 5 HK
test parse spaces in grouping
begin
parse output breaks
// C, H, S, and P get "12" here
-1 2 1 CHP
-1 23 1 CHP
+1 2 1 CHJP
+1 23 1 CHJP
// K gets 1 here; doesn't pick up the grouping separator
1 234 1234 K
// C and J get "1"
// Q gets "1.0"
// K gets "1.1" (??)
-0.975 0.98 CHKQ
+0.975 0.98 CHJKQ
test lenient parse currency match
// This test is for #13112
// C obeys maxIntegerDigits and prints after the decimal place
0 0 .0 HKQ
// C and Q ignore max integer if it is less than zero and prints "123"
-123 -2147483648 0 CQ
+123 -2147483648 0 CJQ
12345 1 5
-12345 -2147483648 0 CQ
+12345 -2147483648 0 CJQ
5.3 1 5.3
-5.3 -2147483648 .3 CQ
+5.3 -2147483648 .3 CJQ
test patterns with zero
set locale en
format multiplier output breaks
23 -12 -276
23 -1 -23
-// H (ICU4J 58) throws exception on zero multiplier.
+// H (ICU4J 58) and J (current ICU4J) throw exception on zero multiplier.
// ICU4C prints 23.
// Q multiplies by zero and prints 0.
-23 0 0 CH
+23 0 0 CHJ
23 1 23
23 12 276
-23 12 -276
-0.35 -0.25 K
0.35 0.25 K
// Q doesn't support mixing minFrac with roundingIncrement (prints 0.50).
-0.39 0.5 KQ
-0.62 0.5 KQ
+0.39 0.5 JKQ
+0.62 0.5 JKQ
0.63 0.75 K
test padding setters
**0,000 **0,000 HK
**##0,000 **##0,000 K
**###0,000 **###0,000 K
-**####0,000 **#,##0,000 CKS
+**####0,000 **#,##0,000 CJKS
###,000. #,000.
-0,000 #0,000 CS
+0,000 #0,000 CJS
.00 #.00
-000 #000 CS
-000,000 #,000,000 CS
+000 #000 CJS
+000,000 #,000,000 CJS
pp#,000 pp#,000
-00.## #00.## CS
+00.## #00.## CJS
#,#00.025 #,#00.025
// No secondary grouping in JDK
#,##,###.02500 #,##,###.02500 K
pp#,000;(#) pp#,000;(#,000) K
-**####,##,##0.0##;(#) **#,##,##,##0.0##;**(##,##,##0.0##) CKS
+**####,##,##0.0##;(#) **#,##,##,##0.0##;**(##,##,##0.0##) CJKS
// No significant digits in JDK
@@### @@### K
@,@#,### @,@#,### K
(34 25E-1) -342.5 K
(34,,25E-1) -342.5
// H doesn't allow trailing separators before E but C and P do
-(34,,25,E-1) -342.5 CHP
+(34,,25,E-1) -342.5 CHJP
(34 25 E-1) -342.5 HK
(34,,25 E-1) -342.5 HK
// Spaces are not allowed after exponent symbol
1,234,,,+ 1234 HK
1,234- -1234
// H, C, and P bail because of trailing separators
-1,234,- -1234 CHP
+1,234,- -1234 CHJP
// J bails here too
1234 - -1234 H
set negativeSuffix 9N
begin
parse output breaks
-// S is the only implementation that passes these cases.
-// C and P consume the '9' as a digit and assumes number is negative
-// H and JDK bail
-6549K 654 CHKP
-// C and P consume the '9' as a digit and assumes number is negative
-// H and JDK bail
-6549N -654 CHKP
+// A non-greedy parse is required to pass these cases.
+// All of the implementations being tested are greedy.
+6549K 654 CHJKP
+6549N -654 CHJKP
test really strange prefix
set locale en
parse output outputCurrency breaks
53.45 fail GBP
£53.45 53.45 GBP
-$53.45 fail USD HP
+$53.45 fail USD HJP
53.45 USD 53.45 USD
53.45 GBP 53.45 GBP
USD 53.45 53.45 USD H
(8) USD -8 USD
-8 USD -8 USD
67 USD 67 USD
-53.45$ fail USD P
+53.45$ fail USD JP
US Dollars 53.45 53.45 USD H
53.45 US Dollars 53.45 USD
US Dollar 53.45 53.45 USD H
parse output outputCurrency breaks
53.45 fail GBP
£53.45 53.45 GBP
-$53.45 fail USD HP
+$53.45 fail USD HJP
53.45 USD 53.45 USD
53.45 GBP 53.45 GBP
USD 53.45 53.45 USD H
USD-7.92 -7.92 USD H
-8 USD -8 USD
67 USD 67 USD
-53.45$ fail USD P
+53.45$ fail USD JP
US Dollars 53.45 53.45 USD H
53.45 US Dollars 53.45 USD
US Dollar 53.45 53.45 USD H
// J throws a NullPointerException on the first case
53.45 fail GBP
£53.45 53.45 GBP
-$53.45 fail USD HP
+$53.45 fail USD HJP
53.45 USD 53.45 USD
53.45 GBP 53.45 GBP
USD 53.45 53.45 USD H
-8 USD -8 USD
67 USD 67 USD
// J throws a NullPointerException on the next case
-53.45$ fail USD P
+53.45$ fail USD JP
US Dollars 53.45 53.45 USD H
53.45 US Dollars 53.45 USD
US Dollar 53.45 53.45 USD H
parse output outputCurrency breaks
53.45 fail GBP
£53.45 53.45 GBP
-$53.45 fail USD HP
+$53.45 fail USD HJP
53.45 USD 53.45 USD
53.45 GBP 53.45 GBP
USD 53.45 53.45 USD H
(8) USD -8 USD
-8 USD -8 USD
67 USD 67 USD
-53.45$ fail USD P
+53.45$ fail USD JP
US Dollars 53.45 53.45 USD H
53.45 US Dollars 53.45 USD
US Dollar 53.45 53.45 USD H
parse output outputCurrency breaks
53.45 fail GBP
£53.45 53.45 GBP
-$53.45 fail USD HP
+$53.45 fail USD HJP
53.45 USD 53.45 USD
53.45 GBP 53.45 GBP
USD 53.45 53.45 USD H
53.45USD 53.45 USD H
USD53.45 53.45 USD
// C and P fail these because '(' is an incomplete prefix.
-(7.92) USD -7.92 USD CHP
-(7.92) GBP -7.92 GBP CHP
-(7.926) USD -7.926 USD CHP
-(7.926 USD) -7.926 USD CHP
+(7.92) USD -7.92 USD CHJP
+(7.92) GBP -7.92 GBP CHJP
+(7.926) USD -7.926 USD CHJP
+(7.926 USD) -7.926 USD CHJP
(USD 7.926) -7.926 USD H
-USD (7.926) -7.926 USD CHP
-USD (7.92) -7.92 USD CHP
-(7.92)USD -7.92 USD CHP
-USD(7.92) -7.92 USD CHP
-(8) USD -8 USD CHP
+USD (7.926) -7.926 USD CHJP
+USD (7.92) -7.92 USD CHJP
+(7.92)USD -7.92 USD CHJP
+USD(7.92) -7.92 USD CHJP
+(8) USD -8 USD CHJP
-8 USD -8 USD
67 USD 67 USD
-53.45$ fail USD P
+53.45$ fail USD JP
US Dollars 53.45 53.45 USD H
53.45 US Dollars 53.45 USD
US Dollar 53.45 53.45 USD H
\u0631\u06cc\u0627\u0644 \u06F1\u06F2\u06F3\u06F5 1235 IRR
IRR \u06F1\u06F2\u06F3\u06F5 1235 IRR
// P fails here because this currency name is in the Trie only, but it has the same prefix as the non-Trie currency
-\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 \u06F1\u06F2\u06F3\u06F5 1235 IRR CP
+\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 \u06F1\u06F2\u06F3\u06F5 1235 IRR CJP
IRR 1235 1235 IRR
\u0631\u06cc\u0627\u0644 1235 1235 IRR
-\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 1235 1235 IRR CP
+\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 1235 1235 IRR CJP
test parse foreign currency ISO
set pattern \u00a4\u00a4 0.00;\u00a4\u00a4 -#
parse output outputCurrency breaks
\u0631\u06cc\u0627\u0644 \u06F1\u06F2\u06F3\u06F5 1235 IRR
IRR \u06F1\u06F2\u06F3\u06F5 1235 IRR
-\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 \u06F1\u06F2\u06F3\u06F5 1235 IRR CP
+\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 \u06F1\u06F2\u06F3\u06F5 1235 IRR CJP
IRR 1235 1235 IRR
\u0631\u06cc\u0627\u0644 1235 1235 IRR
-\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 1235 1235 IRR CP
+\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 1235 1235 IRR CJP
test parse foreign currency full
set pattern \u00a4\u00a4\u00a4 0.00;\u00a4\u00a4\u00a4 -#
parse output outputCurrency breaks
\u0631\u06cc\u0627\u0644 \u06F1\u06F2\u06F3\u06F5 1235 IRR
IRR \u06F1\u06F2\u06F3\u06F5 1235 IRR
-\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 \u06F1\u06F2\u06F3\u06F5 1235 IRR CP
+\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 \u06F1\u06F2\u06F3\u06F5 1235 IRR CJP
IRR 1235 1235 IRR
\u0631\u06cc\u0627\u0644 1235 1235 IRR
-\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 1235 1235 IRR CP
+\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 1235 1235 IRR CJP
test parse currency with foreign symbols symbol english
set pattern \u00a4 0.00;\u00a4 (#)
parse currency output breaks
$52.41 USD 52.41
USD52.41 USD 52.41 K
-\u20ac52.41 USD fail CP
-EUR52.41 USD fail CP
-$52.41 EUR fail CP
-USD52.41 EUR fail CP
+\u20ac52.41 USD fail CJP
+EUR52.41 USD fail CJP
+$52.41 EUR fail CJP
+USD52.41 EUR fail CJP
\u20ac52.41 EUR 52.41 K
EUR52.41 EUR 52.41
set lenient 0
begin
parse output outputCurrency breaks
-$53.45 53.45 USD CP
+$53.45 53.45 USD CJP
53.45 USD 53.45 USD
USD 53.45 fail USD
53.45USD fail USD
-USD53.45 53.45 USD CP
+USD53.45 53.45 USD CJP
(7.92) USD -7.92 USD
(7.92) EUR -7.92 EUR
(7.926) USD -7.926 USD
53.45 US Dollars 53.45 USD
US Dollar 53.45 fail USD
53.45 US Dollar 53.45 USD
-US Dollars53.45 53.45 USD CP
+US Dollars53.45 53.45 USD CJP
53.45US Dollars fail USD
-US Dollar53.45 53.45 USD CP
+US Dollar53.45 53.45 USD CJP
US Dollat53.45 fail USD
53.45US Dollar fail USD
US Dollars (53.45) fail USD
-1E-99999999999999 -0.0
1E2147483648 Inf K
1E2147483647 Inf K
-// H and K get Infinity
-1E2147483646 1E+2147483646 HK
+// H, J and K get Infinity
+1E2147483646 1E+2147483646 HJK
1E-2147483649 0
1E-2147483648 0
// H, K, C and P return zero here
-1E-2147483647 1E-2147483647 CHKP
-1E-2147483646 1E-2147483646 HK
+1E-2147483647 1E-2147483647 CHJKP
+1E-2147483646 1E-2147483646 HJK
test format push limits
set locale en
56i jk -56 HK
56i jk -56 HK
// S and C get 56 (accepts ' ' gs grouping); H and K get null
-5 6 fail CP
+5 6 fail CJP
56 5 HK
test parse spaces in grouping
begin
parse output breaks
// C, H, S, and P get "12" here
-1 2 1 CHP
-1 23 1 CHP
+1 2 1 CHJP
+1 23 1 CHJP
// K gets 1 here; doesn't pick up the grouping separator
1 234 1234 K
// C and J get "1"
// Q gets "1.0"
// K gets "1.1" (??)
-0.975 0.98 CHKQ
+0.975 0.98 CHJKQ
test lenient parse currency match
// This test is for #13112
* @return
*/
private DecimalFormat createDecimalFormat(DataDrivenNumberFormatTestData tuple) {
-
DecimalFormat fmt = new DecimalFormat(tuple.pattern == null ? "0" : tuple.pattern,
new DecimalFormatSymbols(tuple.locale == null ? EN : tuple.locale));
adjustDecimalFormat(tuple, fmt);
fmt.setCurrency(tuple.currency);
}
if (tuple.minGroupingDigits != null) {
- // Oops we don't support this.
+ fmt.setMinimumGroupingDigits(tuple.minGroupingDigits);
}
if (tuple.useSigDigits != null) {
fmt.setSignificantDigitsUsed(tuple.useSigDigits != 0);
fmt.setNegativeSuffix(tuple.negativeSuffix);
}
if (tuple.signAlwaysShown != null) {
- // Not supported.
+ fmt.setSignAlwaysShown(tuple.signAlwaysShown != 0);
}
if (tuple.localizedPattern != null) {
fmt.applyLocalizedPattern(tuple.localizedPattern);
fmt.setParseIntegerOnly(tuple.parseIntegerOnly != 0);
}
if (tuple.parseCaseSensitive != null) {
- // Not supported.
+ fmt.setParseCaseSensitive(tuple.parseCaseSensitive != 0);
}
if (tuple.decimalPatternMatchRequired != null) {
fmt.setDecimalPatternMatchRequired(tuple.decimalPatternMatchRequired != 0);
}
if (tuple.parseNoExponent != null) {
- // Oops, not supported for now
+ fmt.setParseNoExponent(tuple.parseNoExponent != 0);
}
}
};
}
};
- // @Test
- // public void TestDataDrivenICU4J() {
- // DataDrivenNumberFormatTestUtility
- // .runFormatSuiteIncludingKnownFailures("numberformattestspecification.txt", ICU4J);
- // }
+ @Test
+ public void TestDataDrivenICU4J() {
+ DataDrivenNumberFormatTestUtility
+ .runFormatSuiteIncludingKnownFailures("numberformattestspecification.txt", ICU4J);
+ }
@Test
public void TestDataDrivenICU58() {