Determining value of a digit