Convert.ToDouble(“4089.90”) outputs 40.899,00 why?

前端 未结 6 2242
傲寒
傲寒 2021-02-20 16:55

I am developing a software that uses number precision, but I have this problem, it happens that when I take a string to convert to double it outputs me with a different culture.

6条回答
  •  别跟我提以往
    2021-02-20 17:46

    You can set the culture for your thread with:

    Thread.CurrentThread.CurrentCulture = 
           System.Globalization.CultureInfo.InvariantCulture;
    

提交回复
热议问题