double.TryParse method problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

i need some help (this wan't work)

double outDoubleOrgJed;
string orgJed = "1.0000000E+00"

Double.TryParse(orgJed, System.Globalization.NumberStyles.Float , null, out
outDoubleOrgJed)

fails to create double !!

why?
 
Nols,

The reason it fails is because your culture uses , as decimal point, not .

Use the overload the specifies an IFormatProvider

CultureInfo ci = new CultureInfo("en-US");
Double.TryParse(orgJed, NumberStyles.Float, ci.NumberFormat, out outDoubleOrgJed);
 
Back
Top