Mega Code Archive

 
Categories / VB.Net / Data Types
 

Decimal ToInt16 Method Converts Decimal to 16-bit signed integer

Imports System Imports Microsoft.VisualBasic Module DecimalToU_Int16Demo     Sub DecimalToU_Int16( argument As Decimal )         Dim Int16Value    As Object         Dim UInt16Value   As Object         Try             Int16Value = Decimal.ToInt16( argument )         Catch ex As Exception             Console.WriteLine( ex )         End Try         Try             UInt16Value = Decimal.ToUInt16( argument )         Catch ex As Exception             Console.WriteLine( ex )         End Try         Console.WriteLine( Int16Value)         Console.WriteLine( UInt16Value )     End Sub     Sub Main( )         DecimalToU_Int16( 123D )     End Sub  End Module