Converts a number to characters in an array, and converts the characters in an array back to an int