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 ) ; }
Returns the the digit which corresponds to a specific index of a number .