code: public static double roundHalfUp(double d, int scale) {
  		return BigDecimal.valueOf(d).setScale(scale, RoundingMode.HALF_UP).doubleValue();
  	}
docs: Round up a double using the "half up" method.
  @param d a double
  @param scale the scale
  @return a double