在德国,数字9.81(美国)表示为
9,81
以下转换有什么问题?
CultureInfo culture = new CultureInfo("de-DE");
NumberStyles style = NumberStyles.Float ;//| NumberStyles.AllowThousands;
string str = "9,81";
double value = 0.0;
if (double.TryParse(str, style, culture, out value))
Console.WriteLine("Result of conversion: " + value);
else
Console.WriteLine("Numeric conversion failed!");
数值转换失败!
顺便说一句,千位分隔符('。')也不起作用...