Using the Convert class:
xxxxxxxxxx
double doubleValue = 3.14159;
long longValue = Convert.ToInt64(doubleValue);
Casting the double to a long:
xxxxxxxxxx
double doubleValue = 3.14159;
long longValue = (long)doubleValue;
Note that casting a double to a long can result in a loss of precision if the double value has a fractional component that is not zero. In such cases, you may want to consider rounding the double value before casting it to a long.