Question: Please, help me to identify problem in my C# code(WPF, event-handler):

```
        private void Discount5Btn_Click(object sender, RoutedEventArgs e)
    {
        decimal catPr;
        decimal salePr;
        string catPrStr;
        catPrStr = PriceCatTBox.Text;
        catPr = decimal.Parse(catPrStr);
        salePr = decimal.Multiply(catPr, 0.95m);
        SalePriceTBox.Text = (salePr).ToString("0000.00");
    }

```

I can not make it work - debugger shows error on `catPr = decimal.Parse(catPrStr);` . Very similar code in another place works. And am I right in such an approach to string-decimal conversion for arithmetic operation?

**Edit (added)**

Sorry for not specifying  `catPrStr` value, it is from textbox in the following code (in another event-handler):

```
dlg.PriceCatTBox.Text = "2300.00";
....

```

and then as above:

```
catPrStr = PriceCatTBox.Text;

```

Answer: 
> 
> And am I right in such an approach to
>  string-decimal conversion for
>  arithmetic operation?
> 
> 
> 

I would set up two way binding with a model to store your decimal values. This will allow you to access them directly instead of parsing strings. This will also solve your error.
We can't help you because we don't know the value of `catPrStr`, you are converting from `String` to `Decimal` and most likely the value of the string being converted is incorrect.