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

前端 未结 6 2975
傲寒
傲寒 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:48

    Actually is very rare this behaviour cause all the machines have the same culture settings, however I think that the best solution would be to modify the web.config like this:

    configuration>
      
        
      
    

    And apply the settings for the entire application.

    Thanx everyone for your assistance.

提交回复
热议问题