add a helper function to convert from string to numeric