开发者

Does Decimal.Parse() support scientific notation? [duplicate]

This question already has answers here: Closed 11 years ago. 开发者_开发百科

Possible Duplicate:

C# Parse a Number from Exponential Notation

I currently have:

decimal value = Decimal.Parse(dataRow["column"].ToString());

There is some data in the backend that is in scientific notation (ie 3.2661758893885E-05) and which is causing a FormatException on the parse. Is there an easy way to do this?


Try something like this:

Decimal.Parse(strExpression, System.Globalization.NumberStyles.AllowExponent));
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜