开发者

How to parse a number like "-2.000000e+000"

开发者 https://www.devze.com 2023-04-04 21:28 出处:网络
I am trying to read some data from a xml file, numbers are sa开发者_开发问答ved in forms like \"-2.000000e+000\"

I am trying to read some data from a xml file, numbers are sa开发者_开发问答ved in forms like "-2.000000e+000"

I tried to use "double.Parse" but it returns the number as -2000000!!!! can someone please tell me what I am doing wrong?


Pass CultureInfo.InvariantCulture to the call to double.Parse:

double.Parse("-2.000000e+000", CultureInfo.InvariantCulture);
0

精彩评论

暂无评论...
验证码 换一张
取 消