mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-14 17:24:01 +00:00
ICU-22611 Fixed failures in EnvTest.
This commit is contained in:
parent
869cc60f3c
commit
d4bc9bef26
2 changed files with 8 additions and 8 deletions
|
@ -1280,7 +1280,7 @@ void IntlTestRBNF::TestDFRounding()
|
|||
UErrorCode err = U_ZERO_ERROR;
|
||||
|
||||
// no decimal places
|
||||
LocalPointer<RuleBasedNumberFormat> nf0(new RuleBasedNumberFormat(u"1000/1000: <##K<;", parseError, err));
|
||||
LocalPointer<RuleBasedNumberFormat> nf0(new RuleBasedNumberFormat(u"1000/1000: <##K<;", Locale::getUS(), parseError, err));
|
||||
if (U_FAILURE(err)) {
|
||||
errcheckln(err, "FAIL: could not construct formatter - %s", u_errorName(err));
|
||||
} else {
|
||||
|
@ -1295,7 +1295,7 @@ void IntlTestRBNF::TestDFRounding()
|
|||
}
|
||||
|
||||
// 1 decimal place
|
||||
LocalPointer<RuleBasedNumberFormat> nf1(new RuleBasedNumberFormat(u"1000/1000: <##.0K<;", parseError, err));
|
||||
LocalPointer<RuleBasedNumberFormat> nf1(new RuleBasedNumberFormat(u"1000/1000: <##.0K<;", Locale::getUS(), parseError, err));
|
||||
if (U_FAILURE(err)) {
|
||||
errcheckln(err, "FAIL: could not construct formatter - %s", u_errorName(err));
|
||||
} else {
|
||||
|
@ -1308,7 +1308,7 @@ void IntlTestRBNF::TestDFRounding()
|
|||
}
|
||||
|
||||
// with modulus substitution
|
||||
LocalPointer<RuleBasedNumberFormat> nfMod(new RuleBasedNumberFormat(u"1000/1000: <##<K>##>; -x: ->>;", parseError, err));
|
||||
LocalPointer<RuleBasedNumberFormat> nfMod(new RuleBasedNumberFormat(u"1000/1000: <##<K>##>; -x: ->>;", Locale::getUS(), parseError, err));
|
||||
if (U_FAILURE(err)) {
|
||||
errcheckln(err, "FAIL: could not construct formatter - %s", u_errorName(err));
|
||||
} else {
|
||||
|
@ -1323,7 +1323,7 @@ void IntlTestRBNF::TestDFRounding()
|
|||
}
|
||||
|
||||
// no decimal places, but with rounding mode set to ROUND_FLOOR
|
||||
LocalPointer<RuleBasedNumberFormat> nfFloor(new RuleBasedNumberFormat(u"1000/1000: <##K<;", parseError, err));
|
||||
LocalPointer<RuleBasedNumberFormat> nfFloor(new RuleBasedNumberFormat(u"1000/1000: <##K<;", Locale::getUS(), parseError, err));
|
||||
nfFloor->setMaximumFractionDigits(0);
|
||||
nfFloor->setRoundingMode(NumberFormat::kRoundFloor);
|
||||
if (U_FAILURE(err)) {
|
||||
|
|
|
@ -382,26 +382,26 @@ public class RbnfTest extends CoreTestFmwk {
|
|||
RuleBasedNumberFormat nf;
|
||||
|
||||
// no decimal places
|
||||
nf = new RuleBasedNumberFormat("1000/1000: <##K<;");
|
||||
nf = new RuleBasedNumberFormat("1000/1000: <##K<;", Locale.US);
|
||||
assertEquals("-1K", nf.format(-1400));
|
||||
assertEquals("-2K", nf.format(-1900));
|
||||
assertEquals("1K", nf.format(1400));
|
||||
assertEquals("2K", nf.format(1900));
|
||||
|
||||
// 1 decimal place
|
||||
nf = new RuleBasedNumberFormat("1000/1000: <##.0K<;");
|
||||
nf = new RuleBasedNumberFormat("1000/1000: <##.0K<;", Locale.US);
|
||||
assertEquals("-1.4K", nf.format(-1440));
|
||||
assertEquals("1.9K", nf.format(1890));
|
||||
|
||||
// with modulus substitution
|
||||
nf = new RuleBasedNumberFormat("1000/1000: <##<K>##>; -x: ->>;");
|
||||
nf = new RuleBasedNumberFormat("1000/1000: <##<K>##>; -x: ->>;", Locale.US);
|
||||
assertEquals("-1K400", nf.format(-1400));
|
||||
assertEquals("-1K900", nf.format(-1900));
|
||||
assertEquals("1K400", nf.format(1400));
|
||||
assertEquals("1K900", nf.format(1900));
|
||||
|
||||
// no decimal places, but with rounding mode set to ROUND_FLOOR
|
||||
nf = new RuleBasedNumberFormat("1000/1000: <##K<;");
|
||||
nf = new RuleBasedNumberFormat("1000/1000: <##K<;", Locale.US);
|
||||
nf.setMaximumFractionDigits(0);
|
||||
nf.setRoundingMode(BigDecimal.ROUND_FLOOR);
|
||||
assertEquals("-2K", nf.format(-1400));
|
||||
|
|
Loading…
Add table
Reference in a new issue