How can I confidently check if a variable is double?
You need to be clearer about what you are really trying to do here. I don’t think you are asking what you think, what you are asking, and it is worth knowing about the differences in terminology.
, double, a double. , object, ValueType ,
if (value is double)
, , double. double.TryParse - , . , "15,5" double? , , , . ?
, IFormatProvider . , .
, :
double result;
// For suitable values of text, style and culture...
bool valid = double.TryParse(text, style, culture, out result);
valid, , . valid , result . valid , result 0.