EAK31640GW
asked on
String To double conversion...
I am trying to convert a String type of an engineering value to double. i.e. 1.1234E12
Every time I try an sort of conversion whether it be using Convert.ToDouble or Double.Parse I've tried it using System.Globalization.Cultu reInfo.Inv ariantCult ure. So far nothing.... I keep getting the error 'System.FormatException'
Here is some code.
Every time I try an sort of conversion whether it be using Convert.ToDouble or Double.Parse I've tried it using System.Globalization.Cultu
Here is some code.
//configMessage.coeff[] is a Double
//txtCoeff[] is an array of textboxes where the user has input Double precision floating point numbers which can be of various formats. 1234.123463; 12; 1.2345E12;
configMessage.coeff[i] = Convert.ToDouble(uiControl.GetText(txtCoeff[i]),System.Globalization.CultureInfo.InvariantCulture);
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Realized that the problems resided in what I was displaying in text boxes in the first place. My format string was incorrect. I had "0.0###+E0#" instead of "0.0###E+0#"