Implicit conversion of expression results occurs at runtime for certain data type combinations.
For example, implicit conversion occurs if an integer expression is specified as the initial value for a data field that is type float. Note that within an expression, there is no implicit conversion of a string value to a time value; you must use the convert function or stringtotime function to explicitly convert the string value to a time value.
Inside a complex expression, implicit conversion occurs to make the data type of the argument meet the requirements of an operator or function. For example, the substr function takes integer values for the starting position and length arguments. If you specify the float values 2.5 and 1.0 as those arguments, they are implicitly converted to the integer values 2 and 1 before the expression is evaluated.
Implicit conversion occurs at runtime for the following data type combinations:
All digits to the right of the decimal point in the floating point number are truncated. For example, if you specify 123.4567 as the initial value for an integer data field, upon initialization, the data field's value is set to 123.
A decimal point and 0 are appended following the last digit of the integer.
Inside a complex expression containing both float and integer values, implicit conversion occurs if an operator requires the values to be of the same data type. In this case, the integer value is converted to the float data type before evaluating the expression. For example, if you specify 1.5 + 2, the 2 is converted to 2.0.