Convert.ToBoolean(Double) converts double number to Boolean value. : Convert to Boolean « Development « VB.Net






Convert.ToBoolean(Double) converts double number to Boolean value.

  

Class Sample
   Public Shared Sub Main()
        Dim doubleVal As Double
        Dim boolVal As Boolean
        
        doubleVal = 1.1
    
        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)

    End Sub
End Class

   
    
  








Related examples in the same category

1.Convert.ToBoolean converts 8-bit unsigned integer to Boolean value.
2.Convert.ToBoolean(Decimal) converts decimal number to Boolean value.
3.Convert.ToBoolean(Int16) converts 16-bit signed integer to Boolean value.
4.Convert.ToBoolean (Int32) converts 32-bit signed integer to Boolean value.
5.Convert.ToBoolean (Int64) converts 64-bit signed integer to Boolean value.
6.Convert.ToBoolean (Object) converts object to Boolean value.
7.Convert.ToBoolean (SByte) converts 8-bit signed integer to Boolean value.
8.Convert.ToBoolean (Single) converts single-precision number to Boolean value.
9.Convert.ToBoolean (String) converts string to Boolean equivalent.
10.Convert.ToBoolean (UInt16) converts 16-bit unsigned integer to Boolean value.
11.Convert.ToBoolean (UInt32) converts 32-bit unsigned integer to Boolean value.
12.Convert.ToBoolean (UInt64) converts 64-bit unsigned integer to Boolean value.