4

i've a string like1.00E+4

Is there any built in function to convert this string to 10000.(Integer convertion [1.00E+4=10000]).?

Now i'm using regular expression for this kind of strings

Thorin Oakenshield
  • 14,232
  • 33
  • 106
  • 146

1 Answers1

5

You can do:

double.Parse("1.00E+4", CultureInfo.InvariantCulture)
Klaus Byskov Pedersen
  • 117,245
  • 29
  • 183
  • 222
  • Need we specify the `cultureInfo`. ? – Thorin Oakenshield Oct 21 '10 at 11:47
  • Yes, you should always specify cultureinfo (formatprovider). The result varies depending on the formatprovider you use, so it's generally a good idea to always be specific about this so you don't get unexpected results when running on a machine with a different culture. – Klaus Byskov Pedersen Oct 21 '10 at 13:34