Convert.ToDecimal (Int32) converts 32-bit signed integer to decimal number.
Class Sample
Public Shared Sub Main()
Dim numbers() As Integer = { Int32.MinValue, -1000, 0, 1000, Int32.MaxValue }
Dim result As Decimal
For Each number As Integer In numbers
result = Convert.ToDecimal(number)
Console.WriteLine("Converted the Int32 value {0} to the Decimal value {1}.", _
number, result)
Next
End Sub 'Main
End Class 'Sample
Related examples in the same category