How do I parse a string with a decimal point to a double?

前端 未结 19 1698
孤街浪徒
孤街浪徒 2020-11-22 06:47

I want to parse a string like \"3.5\" to a double. However,

double.Parse(\"3.5\") 

yields 35 and

double.Pars         


        
19条回答
  •  面向向阳花
    2020-11-22 07:07

    Multiply the number and then divide it by what you multiplied it by before.

    For example,

    perc = double.Parse("3.555)*1000;
    result = perc/1000
    

提交回复
热议问题