1

Possible Duplicate:
Convert from scientific notation string to float in C#

Is it there an build-in function which converts string in format "2.71e+006" to a number or I have to write my custom algorithm?

Community
  • 1
  • 1
nenito
  • 1,214
  • 6
  • 19
  • 33

1 Answers1

5

The Decimal Parse method has an overload you can use:

decimal d = Decimal.Parse("2.71e+006", System.Globalization.NumberStyles.Float);

You can also do the same for a Double.

Jason Down
  • 21,731
  • 12
  • 83
  • 117