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: 
[`Convert.ToDecimal`](https://msdn.microsoft.com/en-us/library/hf9z3s65%28v=vs.110%29.aspx) uses [`decimal.Parse`](https://msdn.microsoft.com/en-us/library/cafs243z%28v=vs.110%29.aspx) explicitly this method uses [`NumberStyles.Number`](https://msdn.microsoft.com/en-us/library/system.globalization.numberstyles%28v=vs.110%29.aspx) *by default*.

This is a composite style which includes `AllowDecimalPoint` but not `AllowCurrencySymbol` style *even* if your `CurrentCulture`'s [`CurrencySymbol`](https://msdn.microsoft.com/en-us/library/system.globalization.numberformatinfo.currencysymbol%28v=vs.110%29.aspx) is `$` and [`NumberDecimalSeparator`](https://msdn.microsoft.com/en-us/library/system.globalization.numberformatinfo.numberdecimalseparator%28v=vs.110%29.aspx) is `.`.

You can use [`decimal.parse(String, NumberStyles, IFormatProvider)` overlaod](https://msdn.microsoft.com/en-us/library/s84kdbzx%28v=vs.110%29.aspx) that takes these as a parameters like;

```
string s = "$1000.00";
var d = decimal.Parse(s, NumberStyles.AllowCurrencySymbol | NumberStyles.AllowDecimalPoint, 
                      CultureInfo.GetCultureInfo("en-US"));

```

`d` will be `1000` after parsing.
Take the Dollar Sign off of your text first:

Source: $1000

```
double result = 0M;
String value = SomeLabel.Text.Substring(1);
if (Double.TryParse(value, out result)) {
    //
}
return result;

```