SyntaxFix
Write A Post
Hire A Developer
Questions
Assuming your input is a string...
There are 2 ways:
use Double.TryParse()
double temp; bool isNumber = Double.TryParse(input, out temp);
use Regex
bool isNumber = Regex.IsMatch(input,@"-?\d+(\.\d+)?");