Converts double to Boolean value.
using System;
using System.Globalization;
public class Example
{
public static void Main()
{
double doubleVal = 2.0;
bool boolVal;
boolVal = System.Convert.ToBoolean(doubleVal);
System.Console.WriteLine("{0} as a Boolean is: {1}.",
doubleVal, boolVal);
doubleVal = System.Convert.ToDouble(boolVal);
System.Console.WriteLine("{0} as a double is: {1}.",boolVal, doubleVal);
}
}
Related examples in the same category