[Solved] How to check if an object is numeric in C#


If your only trouble is with “NaN” then try this: isNum = Double.TryParse(Convert.ToString(Expression), out retNum) && !Double.IsNaN(retNum);

Btw “Infinity” and “-Infinity” also will be numeric.

solved How to check if an object is numeric in C#