extracting string to number method