ICU-6354 Set default rounding increment, Java implementation

X-SVN-Rev: 25242
This commit is contained in:
Jason Spieth 2009-01-13 17:05:50 +00:00
parent de7d1f06de
commit e386fb0a43

View file

@ -1,7 +1,7 @@
//##header J2SE15
/*
*******************************************************************************
* Copyright (C) 1996-2008, International Business Machines Corporation and *
* Copyright (C) 1996-2009, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
@ -3211,7 +3211,12 @@ public class DecimalFormat extends NumberFormat {
throw new IllegalArgumentException("Invalid rounding mode: "
+ roundingMode);
}
this.roundingMode = roundingMode;
if (getRoundingIncrement() == null) {
setRoundingIncrement(Math.pow(10.0,(double)-getMaximumFractionDigits()));
}
}
// [NEW]