title: Google Currency Converter API Error
body: <p>Here is my ASPX Code:</p>
  
  <pre><code>&lt;%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %&gt;
  
  &lt;asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent"&gt;
  &lt;/asp:Content&gt;
  &lt;asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"&gt;
      &lt;asp:Label ID="Label1" runat="server" Text="From Currency : " ForeColor="Black"&gt;&lt;/asp:Label&gt;
      &lt;asp:TextBox ID="TextBox1" runat="server"&gt;&lt;/asp:TextBox&gt;&lt;br /&gt;&lt;br /&gt;
      &lt;asp:Label ID="Label2" runat="server" Text="To Currency : " ForeColor="Black"&gt;&lt;/asp:Label&gt;
      &lt;asp:TextBox ID="TextBox2" runat="server"&gt;&lt;/asp:TextBox&gt;&lt;br /&gt;&lt;br /&gt;
      &lt;asp:Label ID="Label3" runat="server" Text="Amount : " ForeColor="Black"&gt;&lt;/asp:Label&gt;
      &lt;asp:TextBox ID="TextBox3" runat="server"&gt;&lt;/asp:TextBox&gt;&lt;br /&gt;&lt;br /&gt;
      &lt;asp:Label ID="Label4" runat="server" Text="Rate : " ForeColor="Black"&gt;&lt;/asp:Label&gt;
      &lt;asp:TextBox ID="TextBox4" runat="server"&gt;&lt;/asp:TextBox&gt;&lt;br /&gt;&lt;br /&gt;
      &lt;asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" /&gt;
  &lt;/asp:Content&gt;
  </code></pre>
  
  <p>and my C# Code:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Web.UI;
  using System.Web.UI.WebControls;
  using System.Net;
  using System.Text.RegularExpressions;
  
  public partial class _Default : System.Web.UI.Page
  {
      protected void Page_Load(object sender, EventArgs e)
      {
      }
      protected void Button1_Click(object sender, EventArgs e)
      {
          Decimal amount = 0;
          string fromCurrency = "";
          string toCurrency = "";
          fromCurrency = TextBox1.Text.ToUpper();
          toCurrency = TextBox2.Text.ToUpper();
          amount = Convert.ToDecimal(TextBox3.Text);
  
          WebClient web = new WebClient();
          Uri uri = new Uri(string.Format("http://www.google.com/ig/calculator?hl=en&amp;q={2}{0}%3D%3F{1}", fromCurrency, toCurrency, amount));
          string response = web.DownloadString(uri);
          Regex regex = new Regex("rhs: \\\"(\\d*.\\d*)");
          Match match = regex.Match(response);
          string test = match.ToString();
          decimal rate = Convert.ToDecimal(match.Groups[1].Value);
          TextBox4.Text = rate.ToString();
      }
  }
  </code></pre>
  
  <p>I am using this code for Currency Conversion when i click on Button it gives the error
  "Input string was not in a correct format" in this line
  "decimal rate = Convert.ToDecimal(match.Groups[1].Value);"</p>
  
  <p>I submit value in</p>
  
  <pre><code>TextBox1 : USD
  TextBox1 : INR
  TextBox3 : 1
  </code></pre>