< prev index next >
test/java/text/Format/NumberFormat/BigDecimalFormat.java
Print this page
@@ -791,11 +791,11 @@
// -------------
// 300 zeros
formatted.setLength(0);
from = "123456789";
to = sep_zero.substring(0, 399) + ",123,456,789";
- nf.format(new Long(from), formatted, new FieldPosition(0));
+ nf.format(123456789L, formatted, new FieldPosition(0));
checkFormat(from, formatted, to, ((DecimalFormat)nf).getMultiplier());
/* ------------------------------------------------------------------ */
((DecimalFormat)nf).applyPattern("##0.###");
@@ -808,11 +808,11 @@
// 300 zeros
formatted.setLength(0);
from = "123456789";
to = "-" + nonsep_zero.substring(0, 300) + "123456789." +
nonsep_zero.substring(0, 340);
- nf.format(new Long(from), formatted, new FieldPosition(0));
+ nf.format(123456789L, formatted, new FieldPosition(0));
checkFormat(from, formatted, to, ((DecimalFormat)nf).getMultiplier());
/* ------------------------------------------------------------------ */
((DecimalFormat)nf).applyPattern("#,##0.###");
@@ -825,11 +825,11 @@
// 280 zeros
formatted.setLength(0);
from = Long.toString(Long.MAX_VALUE);
to = sep_zero.substring(0, 373) +
"19,807,040,619,342,712,359,383,728,129";
- nf.format(new Long(from), formatted, new FieldPosition(0));
+ nf.format(Long.MAX_VALUE, formatted, new FieldPosition(0));
checkFormat(from, formatted, to, ((DecimalFormat)nf).getMultiplier());
/* ------------------------------------------------------------------ */
((DecimalFormat)nf).applyPattern("0.###E0");
@@ -842,11 +842,11 @@
// 312 zeros
formatted.setLength(0);
from = Long.toString(Long.MAX_VALUE);
to = "-1.9807040628566084396238503936" +
nonsep_zero.substring(0, 312) + "E28";
- nf.format(new Long(from), formatted, new FieldPosition(0));
+ nf.format(Long.MAX_VALUE, formatted, new FieldPosition(0));
checkFormat(from, formatted, to, ((DecimalFormat)nf).getMultiplier());
/* ------------------------------------------------------------------ */
((DecimalFormat)nf).applyPattern("##0.###E0");
@@ -860,11 +860,11 @@
formatted.setLength(0);
from = Long.toString(Long.MIN_VALUE);
to = "-19807040619342712361531211776" +
nonsep_zero.substring(0, 280) + "." +
nonsep_zero.substring(0, 340) + "E-280";
- nf.format(new Long(from), formatted, new FieldPosition(0));
+ nf.format(Long.MIN_VALUE, formatted, new FieldPosition(0));
checkFormat(from, formatted, to, ((DecimalFormat)nf).getMultiplier());
/* ------------------------------------------------------------------ */
((DecimalFormat)nf).applyPattern("#,##0.###");
@@ -878,11 +878,11 @@
formatted.setLength(0);
from = Long.toString(Long.MIN_VALUE);
to = sep_zero.substring(0, 373) +
"19,807,040,628,566,084,398,385,987,584." +
nonsep_zero.substring(0, 340);
- nf.format(new Long(from), formatted, new FieldPosition(0));
+ nf.format(Long.MIN_VALUE, formatted, new FieldPosition(0));
checkFormat(from, formatted, to, ((DecimalFormat)nf).getMultiplier());
}
/**
* Test for special numbers
< prev index next >