Mega Code Archive

 
Categories / VB.Net Tutorial / Data Type
 

Converts Decimal numbers to SByte values using the explicit Decimal to SByte conversion

Option Strict On Module Main     Public Sub DecimalToS_Byte(argument As Decimal)         Console.WriteLine(argument)                  Dim sByteValue As Object         Try             sByteValue = CByte(argument)         Catch ex As Exception             sByteValue = ex.GetType().Name         End Try         Console.WriteLine(sbyteValue)     End Sub     Public Sub Main( )         DecimalToS_Byte(8d)         DecimalToS_Byte(New Decimal(7, 0, 0, false, 3))     End Sub End Module