Im using very good currency class in c#. Class working good, but when I need convert USD to IDR (Rupian Indonesian) I get this error
"{lhs: \"1,0 U.S. dollar\",rhs: \"9 708,73786 Indonesian rupiahs\",error: \"\",icc: true}"
Issue is caused from space in 9 708,73786. I think that I need remove space. This is code about class:
public static class CurrencyConverter
{
public static string Convert(decimal amount, string from, string to)
{
WebClient web = new WebClient();
string url = string.Format("http://www.google.com/ig/calculator?hl=en&q={0}{1}=?{2}", amount, from.ToUpper(), to.ToUpper());
string response = web.DownloadString(url);
Regex regex = new Regex("rhs: \\\"(\\d*(.|,)\\d*)");
Match match = regex.Match(response);
return System.Convert.ToDecimal(match.Groups[1].Value).ToString();
}
}
}
Probarly I need modify regex, but I dont know what change:
new Regex("rhs: \\\"(\\d*(.|,)\\d*)")
This is screenshot in visual studio 2010 (Windows Form)

I recommend doing this:
Try it here: http://ideone.com/ySISDU