code: private double round(double value, int precision) {
      return BigDecimal.valueOf(value)
          .setScale(precision, RoundingMode.HALF_UP)
          .doubleValue();
    }
docs: Rounds a value to a given precision, using {@link RoundingMode#HALF_UP}.
  
  @param value     value to be rounded
  @param precision number of digits after the decimal point
  @return