9

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?

Community
  • 1
  • 1
Chris Trombley
  • 2,232
  • 1
  • 17
  • 24

1 Answers1

10

Try something like this:

Decimal.Parse(strExpression, System.Globalization.NumberStyles.AllowExponent));
Jonathan Wood
  • 65,341
  • 71
  • 269
  • 466