Hello!
What is the difference if I use double as cast as in (double)value
compare to using Convert.ToDouble(value)
//Tony
if "value" is a double, float, int (or other numerical type), I don't
think there is a difference.
if "value" is a boxed numerical type, but not a boxed decimal, then a
cast will result in a runtime error, while Convert gives the correct
result.
Example:
float f1 = 1.23f;
object o1 = f1;
double d1 = Convert.ToDouble(o1); // succeeds
double d2 = (double)f1; // succeeds, same result
double d3 = (double)o1; // CRASH
Hans Kesting