ICU-11621 Changes in response to code review

X-SVN-Rev: 38594
This commit is contained in:
Stuart Gill 2016-03-31 21:06:49 +00:00
parent 1e38653868
commit aeff22719e

View file

@ -1762,7 +1762,13 @@ public class DecimalFormat extends NumberFormat {
// add the decimal separator if it is to be always shown AND there are no decimal digits
if ((fracBegin == -1) && this.decimalSeparatorAlwaysShown) {
if (fieldPosition.getFieldAttribute() == Field.DECIMAL_SEPARATOR) {
fieldPosition.setBeginIndex(result.length());
}
result.append(decimal);
if (fieldPosition.getFieldAttribute() == Field.DECIMAL_SEPARATOR) {
fieldPosition.setEndIndex(result.length());
}
if (parseAttr) {
// Length of decimal separator is 1.
int decimalSeparatorBegin = result.length() - 1;