CVAUTOEX†
Format†
CVAUTOEX(var)
Function†
- If a variable that stores a string is specified as an argument, it will be converted to an integer if it can be interpreted as an integer, or converted to a real number if it can be interpreted as a real number, and then stored again.
- If neither is possible, the string will not be converted.
- The conversion will only be performed if the result of converting it back to a string matches the original string. (This is the difference between having EX and not.)
- The behavior when a general purpose array variable is used as an argument is undefined.
Arguments†
- var
- Variable to be converted.
Return value†
Related†
Version†
Example†
_val = '3.14' // Assign a string
CVAUTOEX(_val)
GETTYPE(_val) // "3" is output (which is a string)
_val = '3.140000' // Assign a string
CVAUTOEX(_val)
GETTYPE(_val) // "2" is output (which is a real number)