In this situation you must specify that decimal point as used delimiter.
So, if you have this string value "135.009995"; for right parsing you must define this code:
var currentCulture = System.Globalization.CultureInfo.InstalledUICulture;
var numberFormat = (System.Globalization.NumberFormatInfo) currentCulture.NumberFormat.Clone();
numberFormat.NumberDecimalSeparator = ".";
double value = 0;
bool b = Double.TryParse ( values[1], System.Globalization.NumberStyles.Any,
numberFormat, out value );
if ( b ) el.Open = value;
Now, value contains good double value:
No comments:
Post a Comment