code: public static BigDecimal round(BigDecimal value, int accuracy) {
  		MathContext context = new MathContext(accuracy, RoundingMode.HALF_EVEN);
  		BigDecimal factor = BigDecimal.valueOf(10.0).pow(accuracy);
  		return value.multiply(factor).round(context).divide(factor);
  	}
docs: This method is used for arbitrary accuracy rounding.
  
  @param value
  is the value to be rounded.
  @param accuracy
  is the accuracy of the requested rounding. A value greater 0
  is the number of digits after the decimal sign. A value less
  than 0 rounds the number of digits before the decimal sign to
  zero.
  @return The rounded value is returned.