开发者

How to parse a number 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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜