code: public static float round(float f, int decimalPlace) {
        return BigDecimal.valueOf((double) f).setScale(decimalPlace, BigDecimal.ROUND_HALF_UP).floatValue();
     }
docs: Round to certain number of decimals
  
  @param f
  @param decimalPlace
  @return