mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-14 17:24:01 +00:00
ICU-13496 Adds missing NumberFormatter test to ICU4C
X-SVN-Rev: 40682
This commit is contained in:
parent
10ff53a889
commit
c67d9d0a4a
3 changed files with 33 additions and 0 deletions
|
@ -1254,7 +1254,22 @@ void NumberFormatterApiTest::symbols() {
|
|||
12345.67,
|
||||
u"١٢٬٣٤٥٫٦٧ US$");
|
||||
|
||||
assertFormatSingle(
|
||||
u"NumberingSystem in API should win over @numbers keyword",
|
||||
NumberFormatter::with().adoptSymbols(new NumberingSystem(LATN)).unit(USD),
|
||||
Locale("ar@numbers=arab"),
|
||||
12345.67,
|
||||
u"US$ 12,345.67");
|
||||
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
assertEquals("NumberingSystem in API should win over @numbers keyword in reverse order",
|
||||
u"US$ 12,345.67",
|
||||
NumberFormatter::withLocale(Locale("ar@numbers=arab"))
|
||||
.adoptSymbols(new NumberingSystem(LATN))
|
||||
.unit(USD)
|
||||
.formatDouble(12345.67, status)
|
||||
.toString());
|
||||
|
||||
DecimalFormatSymbols symbols = SWISS_SYMBOLS;
|
||||
UnlocalizedNumberFormatter f = NumberFormatter::with().symbols(symbols);
|
||||
symbols.setSymbol(DecimalFormatSymbols::ENumberFormatSymbol::kGroupingSeparatorSymbol, u"!", status);
|
||||
|
|
|
@ -4063,6 +4063,8 @@ for (;;) {
|
|||
|
||||
UnicodeString strBuf;
|
||||
numFmt->format(numberToBeFormat, strBuf);
|
||||
// TODO: Re-enable the following test block. It has been disabled since
|
||||
// the code was first checked-in (r25497)
|
||||
/*
|
||||
int resultDataIndex = 3 + kIndex;
|
||||
// DATA[i][resultDataIndex] is the currency format result
|
||||
|
|
|
@ -1324,6 +1324,22 @@ public class NumberFormatterApiTest {
|
|||
12345.67,
|
||||
"١٢٬٣٤٥٫٦٧ US$");
|
||||
|
||||
assertFormatSingle(
|
||||
"NumberingSystem in API should win over @numbers keyword",
|
||||
"",
|
||||
NumberFormatter.with().symbols(NumberingSystem.LATIN).unit(USD),
|
||||
new ULocale("ar@numbers=arab"),
|
||||
12345.67,
|
||||
"US$ 12,345.67");
|
||||
|
||||
assertEquals("NumberingSystem in API should win over @numbers keyword in reverse order",
|
||||
"US$ 12,345.67",
|
||||
NumberFormatter.withLocale(new ULocale("ar@numbers=arab"))
|
||||
.symbols(NumberingSystem.LATIN)
|
||||
.unit(USD)
|
||||
.format(12345.67)
|
||||
.toString());
|
||||
|
||||
DecimalFormatSymbols symbols = DecimalFormatSymbols.getInstance(new ULocale("de-CH"));
|
||||
UnlocalizedNumberFormatter f = NumberFormatter.with().symbols(symbols);
|
||||
symbols.setGroupingSeparatorString("!");
|
||||
|
|
Loading…
Add table
Reference in a new issue