Convert written digits to digits