Index: ChoiceFormat.java =================================================================== --- ChoiceFormat.java (revision 429305) +++ ChoiceFormat.java (working copy) @@ -191,16 +191,12 @@ */ public StringBuffer format(double value, StringBuffer buffer, FieldPosition field) { - if (Double.isNaN(value) - || (choiceLimits.length > 1 && value < choiceLimits[1])) { - return buffer.append(choiceFormats[0]); - } - for (int i = 2; i < choiceLimits.length; i++) { - if (value >= choiceLimits[i - 1] && value < choiceLimits[i]) { - return buffer.append(choiceFormats[i - 1]); + for(int i = 0; i < choiceLimits.length; i++) { + if (value < choiceLimits[i]) { + return buffer.append(choiceFormats[i == 0 ? 0 : i - 1]); } } - return buffer.append(choiceFormats[choiceFormats.length - 1]); + return choiceFormats.length == 0 ? buffer : buffer.append(choiceFormats[choiceFormats.length - 1]); } /**