if ((2 < formatting.length())
&& (formatting.charAt(1) == '.')
&& Character.isDigit(formatting.charAt(2))) {
numberFormat.setMaximumFractionDigits(
Integer.parseInt(formatting.charAt(2) + ""));
numberFormat.format(number, outputTo, new FieldPosition(0));
return 3;
}
numberFormat.format(number, outputTo, new FieldPosition(0));
return 1;
} else if (
(0 < formatting.length()) && (formatting.charAt(0) == '.')) {
if ((1 < formatting.length())
&& Character.isDigit(formatting.charAt(1))) {
numberFormat.setMaximumFractionDigits(
Integer.parseInt(formatting.charAt(1) + ""));
numberFormat.format(number, outputTo, new FieldPosition(0));
return 2;
}
}
numberFormat.format(number, outputTo, new FieldPosition(0));
return 1;
}