Question: I'm a bit stuck: I am trying to perform an if statement comparing a label.text that originally has a currency string created from `.ToString("C");`

and a decimal. I have tried converting the label to decimal since I'm going to be comparing it to a decimal but it keeps triggering an exception: 

> 
> Input string was not in a correct format.
> 
> 
> 

here is my current code:

```
if(Convert.ToDecimal(SomeLabel.Text) > 1000.00m) { //DO SOMETHING } 
//SomeLabel.Text has a value of $1000.00

```

Answer: 
As per your example. your string value is **$1000.00**.

This contains a **$** sign that's why the compiler is unable to cast string to decimal.

try removing the unusable character by replace. Or try the method below

```
Regex digitsOnly = new Regex(@"[0-9.]");  // this regex matches only digits and decimal 
string decimalnumberstring = digitsOnly.Replace(SomeLabel.Text, "");// replace all non numbers (except decimal) with empty string

```

then try to convert the string value like below.

```
if(Convert.ToDecimal(decimalnumberstring) > 1000.00m) { //DO SOMETHING }

```

hope it helps....
Try this

```
if(decimal.Parse(SomeLabel.Text) > 1000.00m)
{

}

```