code: private int getDigit(final int index, final int number) {
          String format = "%0" + getNumberOfDigits() + "d";
          String formattedNumber = String.format(Locale.getDefault(), format, number);
          String digit = formattedNumber.substring(index, index + 1);
          return Integer.valueOf(digit);
      }
docs: Returns the the digit, which corresponds to a specific index of a number.
  
  @param index
  The index of the digit, which should be retrieved, as an {@link Integer} value
  @param number
  The number, which contains the digit, which should be retrieved, as an {@link
  Integer} value
  @return The digit, which corresponds to the given index, as an {@link Integer} value