C# if statement for making parameters so it's only numbers
I'm trying do an if statement to so it checks if the user entry is 0-9, a decimal point, or a minus sign. The only issue I'm having is to state those parameters in three different if statements. For numbers would I just useif ( number <= 0 || number >= 0)
{
Console.WriteLine("great");
}
but for the negative sign I have no idea how to go about the use of that sign other than an array. In the array would I simply use the symbol "-" and do an if statement for that array?
As for the decimal point I was thinking of it going through a loop to see if it has any decimal points and if it counts more than 1 then it give an error. Please help!