Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Conversion Class

Conversion Class

The Conversion module contains the procedures used to perform various conversion operations.

System.Object
  Microsoft.VisualBasic.Conversion

Namespace:  Microsoft.VisualBasic
Assembly:  Microsoft.VisualBasic (in Microsoft.VisualBasic.dll)

'Declaration
<StandardModuleAttribute> _
Public NotInheritable Class Conversion

The Conversion type exposes the following members.

  NameDescription
Public methodStatic memberCTypeDynamic(Object, Type)Converts an object to the specified type.
Public methodStatic memberCTypeDynamic(Of TargetType)(Object)Converts an object to the specified generic type.
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public methodStatic memberErrorToStringReturns the error message that corresponds to a given error number.
Public methodStatic memberErrorToString(Int32)Returns the error message that corresponds to a given error number.
Public methodStatic memberFix(Decimal)Return the integer portion of a number.
Public methodStatic memberFix(Double)Return the integer portion of a number.
Public methodStatic memberFix(Int16)Return the integer portion of a number.
Public methodStatic memberFix(Int32)Return the integer portion of a number.
Public methodStatic memberFix(Int64)Return the integer portion of a number.
Public methodStatic memberFix(Object)Return the integer portion of a number.
Public methodStatic memberFix(Single)Return the integer portion of a number.
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodStatic memberHex(Byte)Returns a string representing the hexadecimal value of a number.
Public methodStatic memberHex(Int16)Returns a string representing the hexadecimal value of a number.
Public methodStatic memberHex(Int32)Returns a string representing the hexadecimal value of a number.
Public methodStatic memberHex(Int64)Returns a string representing the hexadecimal value of a number.
Public methodStatic memberHex(Object)Returns a string representing the hexadecimal value of a number.
Public methodStatic memberHex(SByte)Returns a string representing the hexadecimal value of a number.
Public methodStatic memberHex(UInt16)Returns a string representing the hexadecimal value of a number.
Public methodStatic memberHex(UInt32)Returns a string representing the hexadecimal value of a number.
Public methodStatic memberHex(UInt64)Returns a string representing the hexadecimal value of a number.
Public methodStatic memberInt(Decimal)Return the integer portion of a number.
Public methodStatic memberInt(Double)Return the integer portion of a number.
Public methodStatic memberInt(Int16)Return the integer portion of a number.
Public methodStatic memberInt(Int32)Return the integer portion of a number.
Public methodStatic memberInt(Int64)Return the integer portion of a number.
Public methodStatic memberInt(Object)Return the integer portion of a number.
Public methodStatic memberInt(Single)Return the integer portion of a number.
Public methodStatic memberOct(Byte)Returns a string representing the octal value of a number.
Public methodStatic memberOct(Int16)Returns a string representing the octal value of a number.
Public methodStatic memberOct(Int32)Returns a string representing the octal value of a number.
Public methodStatic memberOct(Int64)Returns a string representing the octal value of a number.
Public methodStatic memberOct(Object)Returns a string representing the octal value of a number.
Public methodStatic memberOct(SByte)Returns a string representing the octal value of a number.
Public methodStatic memberOct(UInt16)Returns a string representing the octal value of a number.
Public methodStatic memberOct(UInt32)Returns a string representing the octal value of a number.
Public methodStatic memberOct(UInt64)Returns a string representing the octal value of a number.
Public methodStatic memberStrReturns a String representation of a number.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Public methodStatic memberVal(Char)Returns the numbers contained in a string as a numeric value of appropriate type.
Public methodStatic memberVal(Object)Returns the numbers contained in a string as a numeric value of appropriate type.
Public methodStatic memberVal(String)Returns the numbers contained in a string as a numeric value of appropriate type.
Top

This module supports the Visual Basic language keywords and run-time library members that convert decimal numbers to other bases, numbers to strings, strings to numbers, and one data type to another.

This example uses the Hex function to return the hexadecimal value of a number.

Dim TestHex As String 
' Returns 5.
TestHex = Hex(5)
' Returns A.
TestHex = Hex(10)
' Returns 1CB.
TestHex = Hex(459)

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2015 Microsoft