}
public void TestBug3()
{
double myNumber = -123456;
DecimalFormat form = null;
Locale locale[] = {
new Locale("ar", "", ""),
new Locale("be", "", ""),
new Locale("bg", "", ""),
new Locale("ca", "", ""),
new Locale("cs", "", ""),
new Locale("da", "", ""),
new Locale("de", "", ""),
new Locale("de", "AT", ""),
new Locale("de", "CH", ""),
new Locale("el", "", ""), // 10
new Locale("en", "CA", ""),
new Locale("en", "GB", ""),
new Locale("en", "IE", ""),
new Locale("en", "US", ""),
new Locale("es", "", ""),
new Locale("et", "", ""),
new Locale("fi", "", ""),
new Locale("fr", "", ""),
new Locale("fr", "BE", ""),
new Locale("fr", "CA", ""), // 20
new Locale("fr", "CH", ""),
new Locale("he", "", ""),
new Locale("hr", "", ""),
new Locale("hu", "", ""),
new Locale("is", "", ""),
new Locale("it", "", ""),
new Locale("it", "CH", ""),
new Locale("ja", "", ""),
new Locale("ko", "", ""),
new Locale("lt", "", ""), // 30
new Locale("lv", "", ""),
new Locale("mk", "", ""),
new Locale("nl", "", ""),
new Locale("nl", "BE", ""),
new Locale("no", "", ""),
new Locale("pl", "", ""),
new Locale("pt", "", ""),
new Locale("ro", "", ""),
new Locale("ru", "", ""),
new Locale("sh", "", ""), // 40
new Locale("sk", "", ""),
new Locale("sl", "", ""),
new Locale("sq", "", ""),
new Locale("sr", "", ""),
new Locale("sv", "", ""),
new Locale("tr", "", ""),
new Locale("uk", "", ""),
new Locale("zh", "", ""),
new Locale("zh", "TW", "") // 49
};
StringBuffer buffer = new StringBuffer();
ParsePosition parsePos = new ParsePosition(0);
int i;
for (i= 0; i < 49; i++) {
// form = (DecimalFormat)NumberFormat.getCurrencyInstance(locale[i]);
form = (DecimalFormat)NumberFormat.getInstance(locale[i]);
if (form == null) {
errln("Number format creation failed for " + locale[i].getDisplayName());
continue;
}
FieldPosition pos = new FieldPosition(0);
buffer.setLength(0);
form.format(myNumber, buffer, pos);
parsePos.setIndex(0);
Object result = form.parse(buffer.toString(), parsePos);
logln(locale[i].getDisplayName() + " -> " + result);
if (parsePos.getIndex() != buffer.length()) {
errln("Number format parse failed.");
}
}