double d = 1.0; int places = 4; // See BigDecimal javadoc about why you often want to use the String constructor double rounded_double = new BigDecimal(d.toString()).setScale(places,BigDecimal.ROUND_HALF_UP).doubleValue();
View All Comments
| View Tutorial