Question: I need to find out what value the user has entered into a textbox.

The user could've entered an integer, double or decimal number into the textbox. 

Which one should I use to validate the value?

```
Double.Parse(txtboxNo.text) 
int.Parse(txtboxNo.text);
Decimal.Parse(txtboxNo.text)

```

I tried this (if user enter 1 or 1.8, this function still work):

```
public bool IsNumeric(string strNbr)
{
    Double d_Nbr;

    try
    {
        d_Nbr = Double.Parse(strNbr);
        return true;
    }
    catch (Exception ex)
    {
        return false;
    }
}

```

My problem:
I am working on a mobile Sales App. The sales man has the rights to change the price. Salesman want to work fast. So, I need to detect if he enter a correct price ( my price is decimal) what if he enter : example: 1 or 1.0 or 23 or 333.0 or press for fun 123456 . How I handle ?

Answer: 
I'm not sure about the purpose but you may try the TryParse() Method of Double/Int/Decimal to Validate the string Value. 

```
if (Double.TryParse(value, out number))
   Console.WriteLine(number);
else
   Console.WriteLine("{0} is outside the range of a Double.",

```

MSDN article: 
<http://msdn.microsoft.com/en-us/library/994c0zb1%28v=vs.110%29.aspx>
You may use\*

```
double output;
if(double.tryParse(txtboxNo.Text,output))
{
 // it's double
}
else{// not double }

```