refined check for whole number, reject non-digit