code: public static BigDecimal roundTo(final BigDecimal bd, final int numberOfDecPlaces, final int finalScale) {
          return setScale(setScale(bd, numberOfDecPlaces, BigDecimal.ROUND_HALF_UP), finalScale);
      }
docs: returns a new BigDecimal with correct scale after being round to n dec places.
  
  @param bd value
  @param numberOfDecPlaces number of dec place to round to
  @param finalScale final scale of result (typically numberOfDecPlaces &lt; finalScale);
  @return new bd or null