Data Conversion

In thinkScript®, input parameters of functions always have expected data types. However, some of them can accept values of other data types as valid parameters: those are automatically converted to the default ones. Data type compatibility and rules of conversion are listed in the table below.

Argument Data Accepted Conversion Rule
Any boolean, double, IDataHolder, int, String -
boolean double, IDataHolder, int 0 (0.0) and Double.NaN are converted to no (false), other numbers to yes (true).
CustomColor - -
double boolean, IDataHolder, int yes is converted to 1.0, no to 0.0.
IDataHolder boolean, double, int A number is converted to an array whose elements are all equal to that number. Logical values are preliminary converted to numerical.
int boolean, double, IDataHolder yes is converted to 1, no to 0. Non-integer numbers are rounded towards zero.
String Symbol