Conversion Functions are useful when you are attempting to change the data type of a specified input data field. In this section, you can find useful information on how to insert these functions into your Data Diagrams as well as descriptions of each function.
Figure 1: The available Conversion Functions as shown in the Functions dialog.
Usage
To insert any of these Conversion Functions to change the data type of any given data field, you will need to first select Functions from the Side Menu and find the Conversion Function of your choice in the conversion group. Once this object is selected, you will notice a function object will be inserted into the Design Surface for you to proceed with your data mapping. As an example, if we wanted to only return integer values of our product prices for our orders database table, we can use the To Integer function to convert our present values to integer values. For all Conversion Functions, once added to the Data Diagram, simply map the output data connector from the data source to the input connector of the function. This will create the necessary data connection. Next, map the result to your output data source. In Figure 2, we have mapped both the integer value and the original unit price value to our output to demonstrate the result of the function.
Figure 2: The To Integer function is used to convert the unit price values to integer.
Figure 3: The output preview reveals both the integer values and original values of the unit price field.
Function Descriptions
Below you will find helpful descriptions on each Conversion Function and its intended usage.
To Bool |
A Boolean data type is used to return either True or False. This function converts all data types, with the exception of the DateTime format, to Boolean values. All numbers other than "0" are converted into "true" and "0" is converted into "false". String values other than "true" convert into "false".
To Byte |
You can use this function to convert a numerical value to byte format.
To Short |
The Short data type can be used to represent a whole number which may take less storage and having a smaller range. The To Short function will convert Boolean or numerical values to short values.
To Int |
For situations where the Integer data type is required, the To Int function can be used to convert both Boolean or numerical values to integer values.
To Long |
For needs that require a larger integer values data types, you can use the To Long function to convert Boolean or Numerical values to Long value types.
To ushort |
The ushort data type is a 16-bit integer from 0 to 65,535. Select this function to convert values to the ushort data type.
To uint |
The uint data type is for four byte unsigned integers ranging from 0 to 4,294,967,295, inclusive. Use the To uint function to convert current values into this data type.
To ulong |
The ulong data type is for unsigned 64 bit integers ranging between 0 to 18,446,744,073,709,551,615. Use the To ulong function to convert current values into this data type.
To Float |
The Float data type is stored as four bytes and is a single precision floating point number. To convert any current values to the Float data type, use the To Float function.
To Double |
The Double data type is used for double-precision floating point numbers. To convert any current values to the Double data type, use the To Double function.
To DateTime |
The DateTime data type is used to represent an instance in time, usually for data and time specifically. To convert any data type into date format, use the To DateTime function.
To Number |
Use To Number to convert data types to the Number data type.
To String |
The String data type is used for a sequence of characters. To convert all data types into the string data type, use the To String function.