Add from_str() function to numeric types