digit->integer to handle all Nd characters