+// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
// Copyright (C) 2015-2016, International Business Machines
// Corporation and others. All Rights Reserved.
//
format output breaks
// min grouping digits not supported in any existing implementation
// but could be easily added to the new DecimalFormat C code.
-1000 1000 CJK
+1000 1000 JK
10000 10,000
100000 100,000
1000000 1,000,000
1,23,45,6789 4 K 2
1,23,45,6789 4 K 2 2
123,456789 6 K 6 3
-123456789 6 CJK 6 4
+123456789 6 JK 6 4
test multiplier setters
set locale en_US
NaN beforeSuffix NaN K
NaN afterSuffix NaN K
-test apply localized patterns
+test apply formerly localized patterns
begin
-locale localizedPattern format output breaks
-en 0% 0.4376 44%
+// documentation says localizedPattern is not supported, change to pattern
+locale pattern format output breaks
+en #0% 0.4376 44%
// This next test breaks JDK. JDK doesn't multiply by 100.
-fa \u06f0\u066a 0.4376 \u06f4\u06f4\u066a K
+// It also is now broken in ICU4J until #10368 is fixed.
+fa \u0025\u00a0\u0023\u0030 0.4376 \u200e\u066a\u00a0\u06f4\u06f4 JK
test toPattern
set locale en
// test locale without currency information
{"root", "-1.23", "USD", "-US$ 1.23", "-USD 1.23", "-1.23 USD"},
{"root@numbers=latn", "-1.23", "USD", "-US$ 1.23", "-USD 1.23", "-1.23 USD"}, // ensure that the root locale is still used with modifiers
- {"root@numbers=arab", "-1.23", "USD", "\u200F-US$ ١٫٢٣", "\u200F-USD ١٫٢٣", "\u200F-١٫٢٣ USD"}, // ensure that the root locale is still used with modifiers
+ {"root@numbers=arab", "-1.23", "USD", "\u200F-\u0661\u066B\u0662\u0663\u00A0US$", "\u200F-\u0661\u066B\u0662\u0663\u00A0USD", "\u200F-\u0661\u066B\u0662\u0663 USD"}, // ensure that the root locale is still used with modifiers
{"es_AR", "1", "INR", "INR\u00A01,00", "INR\u00A01,00", "1,00 rupia india"},
- {"ar_EG", "1", "USD", "US$ ١٫٠٠", "USD ١٫٠٠", "١٫٠٠ دولار أمريكي"},
+ {"ar_EG", "1", "USD", "١٫٠٠\u00A0US$", "١٫٠٠\u00A0USD", "١٫٠٠ دولار أمريكي"},
};
for (int i=0; i<DATA.length; ++i) {
// using 'k' currency style.
String formatResult = DATA[i][resultDataIndex];
if (!strBuf.equals(formatResult)) {
- errln("FAIL: Expected " + formatResult + " actual: " + strBuf);
+ errln("FAIL: localeID: " + localeString + ", expected(" + formatResult.length() + "): \"" + formatResult + "\", actual(" + strBuf.length() + "): \"" + strBuf + "\"");
}
try {
// test parsing, and test parsing for all currency formats.
new ParseCurrencyItem( "en_GB", "euros4", "4,00\u00A0\u20AC", 0, 0, 0, 0, "" ),
new ParseCurrencyItem( "en_GB", "euros6", "6\u00A0\u20AC", 0, 0, 0, 0, "" ),
new ParseCurrencyItem( "en_GB", "euros8", "\u20AC8", 0, 0, 2, 8, "EUR" ),
- new ParseCurrencyItem( "en_GB", "dollars4", "$4", 0, 0, 2, 4, "USD" ),
+ new ParseCurrencyItem( "en_GB", "dollars4", "US$4", 0, 0, 4, 4, "USD" ),
new ParseCurrencyItem( "fr_FR", "euros4", "4,00\u00A0\u20AC", 6, 4, 6, 4, "EUR" ),
new ParseCurrencyItem( "fr_FR", "euros6", "6\u00A0\u20AC", 3, 6, 3, 6, "EUR" ),