better string to number conversion for comparison