Im getting this error when i debug my program
An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll
public partial class Form1 : Form
{
int newCount;
int oldCount;
private void timerGetData_Tick(object sender, EventArgs e)
{
string u = webBrowser1.DocumentText;
u = u.Substring(u.IndexOf("<span id=\"PCoins\" class=\"Pcoins\""));
u = u.Substring(u.IndexOf(">") + 1);
u = u.Substring(0, u.IndexOf("</span>"));
textBoxCoins.Text = u;
newCount = Convert.ToDecimal(u);
if (newCount <= oldCount)
{
textBoxNewCount.Text = "WON";
oldCount = newCount;
}
else
{
oldCount = newCount;
textBoxNewCount.Text = "LOSS";
}
timerGetData.Stop();
}
}
The debugging is stopping at newCount = Convert.ToDecimal(u);
Can anyone help me?