Mega Code Archive

 
Categories / VB.Net / Data Types
 

Decimal ToInt64 Method Converts Decimal to 64-bit signed integer

Imports System Imports Microsoft.VisualBasic Module DecimalToU_Int64Demo     ' Convert the Decimal argument; catch exceptions that are thrown.     Sub DecimalToU_Int64( argument As Decimal )         Dim Int64Value    As Object         Dim UInt64Value   As Object                  Try             Int64Value = Decimal.ToInt64( argument )         Catch ex As Exception             Console.WriteLine( ex )         End Try         Try             UInt64Value = Decimal.ToUInt64( argument )         Catch ex As Exception             Console.WriteLine( ex )         End Try         Console.WriteLine( Int64Value )         Console.WriteLine( UInt64Value )     End Sub     Sub Main( )         DecimalToU_Int64( 123D )     End Sub  End Module