Mega Code Archive

 
Categories / VB.Net / Development
 

Convert ToDecimal (Int16) converts 16-bit signed integer to decimal number

Class Sample    Public Shared Sub Main()         Dim numbers() As Short = { Int16.MinValue, -1000, 0, 1000, Int16.MaxValue }         Dim result As Decimal                  For Each number As Short In numbers            result = Convert.ToDecimal(number)            Console.WriteLine("Converted the Int16 value {0} to the Decimal value {1}.", _                              number, result)         Next    End Sub 'Main End Class 'Sample