string to double 时报异常 input string was not in the correct format

这个问题会在多语言系统下出现,原因可能是不通语言数据类型转换时对数据类型格式有强制要求,需要指定当前语言及数据格式

string intOutFirstResulte = "";//需要转换的结果值

double doubleOneValue = 0;//最终返回结果值

double.TryParse(intOutFirstResulte , System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture, out doubleOneValue);

posted @ 2022-04-09 13:12  Mark's.T  阅读(355)  评论(0)    收藏  举报