Hi Thomas,
"ool" <so***@no.spam> wrote in message
news:bk**********@atlantis.news.tpi.pl...
Hello,
How I can convert value from string to double.
When I do this in that way:
String sParam="150.00";
double dbValue= Convert.ToDouble(szParam);
I get System.FormatEcxeption
A hunch.
I note that your post seems to originate from Poland, yes? According to
Windows, the Polish culture uses a comma to seperate whole part from decimal
part. Assuming the number you are trying to parse follows the English (U.S.)
format, you could create a CultureInfo object and pass it as the second
(IFormatProvider) parameter to the Convert.ToDouble method.
System.Globalization.CultureInfo enUSCulture =
new System.Globalization.CultureInfo("en-US");
String sParam = "150.00";
double dbValue = Convert.ToDouble(szParam, enUSCulture);
Regards,
Dan