Input string was not in a correct format #2

后端 未结 10 1269
一向
一向 2020-12-03 21:24
double temp;
temp = (double)Convert.ToDouble(\"1234.5678\");

Hey Lads and Ladies, I can\'t for the life of me figure out why the above line isn\'t

10条回答
  •  暖寄归人
    2020-12-03 22:04

    Hi as Mario says you must parse it taking into account the regional settings.

    double temp = double.Parse("1234.5678", System.Globalization.CultureInfo.CurrentCulture);
    

    Regards.

提交回复
热议问题