Type Cast
Last updated
Was this helpful?
Last updated
Was this helpful?
The Type Cast action, found under the @Generic element in Avo Assure, is used to convert the format of one variable to another and store the result in a dynamic variable for further use.
Input Value: <Variable>;<typecast type>
<Variable> (Required)
It changes the type of data from one form to another so it can be used in the right way.
<typecast type> (Required)
a) Int (Integer): It is used to store numbers without any decimal or fractional part. It used to convert from another type to integer type (double to int, float to int).
b) Float: The float is used to convert numbers into decimal point. It used to convert from another type to float type (double to float, int to float).
c) Double: A double variable that stores numeric values with decimal points, such as floating-point numbers. It used to convert from another type to integer (int to double, float to double).
d) String: values of string variables may include numbers, letters, or symbols. It used to convert date type to string.
Output Value:
<Dynamic Variable>
(Required)
This variable stores the value or string after conversion
<Dynamic Variable>
(Optional)
This variable stores the status as true or false
Example:
Type cast the value (98) to type (float) The Type Cast action takes the value from the Input value column (98) and converts it to the specified type (float). After conversion, the result is stored as (98.0) in the {Type Casted Value} variable, and whereas the operation status is stored in the {Status} variable:
True if the conversion successful or
False if the conversion failed due to invalid input or type.