Does Decimal.Parse() support scientific notation? [duplicate]
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));
精彩评论