code: public static String divide(String dividend, String divisor, int scale) {
          BigDecimal bdDividend;
          BigDecimal bdDivisor;
  
          try {
              bdDividend = new BigDecimal(dividend);
              bdDivisor = new BigDecimal(divisor);
              return bdDividend.divide(bdDivisor, scale, RoundingMode.HALF_UP).toString();
          } catch (Exception e) {
              return null;
          }
      }
docs: Get the result of dividend divided by divisor with given scale.
  
  Any numeric string recognized by {@code BigDecimal} is supported.
  
  @param dividend A valid number string
  @param divisor A valid number strings
  @param scale scale of the {@code BigDecimal} quotient to be returned.
  
  @return <code>dividend / divisor</code>
  
  @see BigDecimal