read_ndx: fix bug in changing number of digits