Conversion Functions

Top Previous Topic Next Topic  Print this topic

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.

conv_intro        

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.

conv_diag

Figure 2:  The To Integer function is used to convert the unit price values to integer.  

conv_out

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

conv_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

conv_byte

You can use this function to convert a numerical value to byte format.

To Short

conv_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

conv_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

conv_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

conv_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

conv_unit

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

conv_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

conv_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

conv_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

conv_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

conv_number

Use To Number to convert data types to the Number data type.

To String

conv_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.