<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Getting Started</title><link>http://forums.asp.net/15.aspx</link><description>The perfect forum for ASP.NET novices. No question too simple! &lt;A href="http://aspadvice.com/SignUp/list.aspx?l=21&amp;amp;c=17" target=_blank&gt;Email List&lt;/A&gt;</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Convert.toDouble input string was not in correct format</title><link>http://forums.asp.net/thread/3274929.aspx</link><pubDate>Sat, 04 Jul 2009 19:36:37 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3274929</guid><dc:creator>veddzik</dc:creator><author>veddzik</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3274929.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=15&amp;PostID=3274929</wfw:commentRss><description>&lt;p&gt;Thank you guys for all your answers. Method TryParse resolved my problem.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Convert.toDouble input string was not in correct format</title><link>http://forums.asp.net/thread/3274740.aspx</link><pubDate>Sat, 04 Jul 2009 14:44:50 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3274740</guid><dc:creator>hminaya</dc:creator><author>hminaya</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3274740.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=15&amp;PostID=3274740</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;What culture are u using?&lt;/p&gt;</description></item><item><title>Re: Convert.toDouble input string was not in correct format</title><link>http://forums.asp.net/thread/3274734.aspx</link><pubDate>Sat, 04 Jul 2009 14:38:38 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3274734</guid><dc:creator>shahed.kazi</dc:creator><author>shahed.kazi</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3274734.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=15&amp;PostID=3274734</wfw:commentRss><description>&lt;p&gt;I tried the code &lt;/p&gt;&lt;p&gt;&lt;i&gt;string ax = &amp;quot;$22.50&amp;quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ax = ax.Replace(&amp;quot;$&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ax = ax.Replace(&amp;quot;.&amp;quot;, &amp;quot;,&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Response.Write(&amp;quot;ax is &amp;quot; + ax);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; double dx = Convert.ToDouble(ax);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Response.Write(&amp;quot;dx is: &amp;quot; +dx.ToString());&lt;/i&gt;&lt;/p&gt;&lt;p&gt;and it works fine.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Convert.toDouble input string was not in correct format</title><link>http://forums.asp.net/thread/3274122.aspx</link><pubDate>Sat, 04 Jul 2009 00:40:04 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3274122</guid><dc:creator>malcolms</dc:creator><author>malcolms</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3274122.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=15&amp;PostID=3274122</wfw:commentRss><description>&lt;p&gt;A good idea also is to use TryParse.&amp;nbsp; That will catch any errors:&lt;pre name="code" class="c-sharp"&gt;double result = 0;
if(double.TryParse(yourstring, out result))
{
      // valid double
}&lt;/pre&gt;&lt;br /&gt; &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Convert.toDouble input string was not in correct format</title><link>http://forums.asp.net/thread/3274093.aspx</link><pubDate>Fri, 03 Jul 2009 23:49:46 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3274093</guid><dc:creator>ctheriault</dc:creator><author>ctheriault</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3274093.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=15&amp;PostID=3274093</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;It also depends of the current culture of the thread executing Convert.ToDouble()&lt;/p&gt;
&lt;p&gt;For instance Convert.ToDouble(&amp;quot;22,50&amp;quot;) works fine if CurrentCulture is French because French use a coma as decimal separator.&lt;/p&gt;
&lt;p&gt;You don&amp;#39;t necessare need to change the default of the thread&amp;#39;s culture; you can define the convesion provider. You don&amp;#39;t necessary need to remove the currency symbol either if you provide the proper conversion params. For instance in the snippet below I also assumed you would need to have a space as group separator instead of the american style&amp;#39;s coma:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;pre class="c-sharp" name="code"&gt;System.Globalization.NumberFormatInfo nfi = new
System.Globalization.NumberFormatInfo();
nfi.CurrencySymbol = &amp;quot;£&amp;quot;;
nfi.CurrencyDecimalSeparator = &amp;quot;,&amp;quot;;
nfi.NumberGroupSeparator = &amp;quot; &amp;quot;;
nfi.NumberDecimalDigits = 2;
decimal d = Decimal.Parse(&amp;quot;£78 022.50&amp;quot;, nfi);&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;Bye&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="WIDOWS:2;TEXT-TRANSFORM:none;TEXT-INDENT:0px;BORDER-COLLAPSE:separate;FONT:16px &amp;#39;times new roman&amp;#39;;WHITE-SPACE:normal;ORPHANS:2;LETTER-SPACING:normal;COLOR:#000000;WORD-SPACING:0px;-webkit-border-horizontal-spacing:0px;-webkit-border-vertical-spacing:0px;-webkit-text-decorations-in-effect:none;-webkit-text-size-adjust:auto;-webkit-text-stroke-width:0px;"&gt;&lt;span style="FONT-FAMILY:Verdana;-webkit-border-horizontal-spacing:1px;-webkit-border-vertical-spacing:1px;"&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Convert.toDouble input string was not in correct format</title><link>http://forums.asp.net/thread/3273945.aspx</link><pubDate>Fri, 03 Jul 2009 19:23:07 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3273945</guid><dc:creator>srinivaskotra</dc:creator><author>srinivaskotra</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3273945.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=15&amp;PostID=3273945</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Hi,&lt;/p&gt;
&lt;p&gt;Dim dbl As Double&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim str As String = &amp;quot;£22.50&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Str = Str.Replace(&amp;quot;£&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Str = Str.Replace(&amp;quot;.&amp;quot;, &amp;quot;,&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dbl = Convert.ToDouble(str)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TextBox1.Text =&amp;nbsp;dbl;&lt;/p&gt;
&lt;p&gt;This is working&amp;nbsp;with me&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Convert.toDouble input string was not in correct format</title><link>http://forums.asp.net/thread/3273929.aspx</link><pubDate>Fri, 03 Jul 2009 19:07:46 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3273929</guid><dc:creator>nijhawan.saurabh</dc:creator><author>nijhawan.saurabh</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3273929.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=15&amp;PostID=3273929</wfw:commentRss><description>&lt;p&gt;{&lt;br /&gt;&lt;/p&gt;&lt;p&gt;string s = &amp;quot;22.45&amp;quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; double p = Convert.ToDouble(s);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Response.Write(p.ToString());&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;This worked perfectly fine.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Convert.toDouble input string was not in correct format</title><link>http://forums.asp.net/thread/3273803.aspx</link><pubDate>Fri, 03 Jul 2009 16:03:49 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3273803</guid><dc:creator>veddzik</dc:creator><author>veddzik</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3273803.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=15&amp;PostID=3273803</wfw:commentRss><description>&lt;p&gt;Hello, &lt;/p&gt;&lt;p&gt;I can&amp;#39;t figure out why it&amp;#39; possible to convert my string. Error message is:&lt;i&gt;&lt;b&gt; input string was not in correct format&lt;/b&gt;&lt;/i&gt; &lt;/p&gt;&lt;p&gt;This is my code, which make an error:&lt;/p&gt;&lt;p&gt;&lt;pre name="code" class="vb.net"&gt;Dim dbl as Double
Dim str as String = &amp;quot;£22.50&amp;quot;)
str = str.Replace(&amp;quot;£&amp;quot;, &amp;quot;&amp;quot;)
str = str.Replace(&amp;quot;.&amp;quot;, &amp;quot;,&amp;quot;)
dbl = Convert.ToDouble(str)&lt;/pre&gt;&lt;/p&gt;&lt;p&gt;But if I try this, it&amp;#39;s work: &lt;/p&gt;&lt;pre name="code"&gt;dbl = Convert.ToDouble(&amp;quot;22,50&amp;quot;)&lt;br /&gt;&lt;br /&gt;What&amp;#39;s going on ?&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;</description></item></channel></rss>