Mega Code Archive

 
Categories / VB.Net / Development
 

Convert ToDecimal (Boolean) converts Boolean value to decimal number

Class Sample    Public Shared Sub Main()         Dim flags() As Boolean = { True, False }         Dim result As Decimal                  For Each flag As Boolean In flags            result = Convert.ToDecimal(flag)            Console.WriteLine("Converted {0} to {1}.", flag, result)         Next    End Sub 'Main End Class 'Sample