This topic provides code samples of how to convert one data type to another data type.
-
Convert Object to String
myString = myObject.ToString()
-
Convert String to Integer
myInteger = Int32.Parse(myString)
-
Convert String to Integer and return Boolean
myBoolean = Int32.TryParse(myString, myInteger)
-
Convert various types to Integer
myInteger = CInt(myObject)
-
Cut off fractional values and convert Double to Integer
myInteger = CInt(Math.Truncate(myDouble))