IS FLOAT Predicate
Use IS FLOAT to determine if a particular result can be assigned to a column of the given data type. It is especially useful for cleaning data or validating data input. When applied to row value expressions, all elements must test the same.
The IS FLOAT predicate takes the following form:
IS [NOT] FLOAT
For example:
x IS FLOAT
is true if x is float in form. If x is a string, then this is true if the value is a number that can be stored as a float data type. All integers and decimals can be represented as float but there may be some loss of accuracy. Any leading or trailing white space is ignored.
If all values in a column pass this predicate then the whole column can be coerced into a float column.
The following predicates are all true:
' +12345 ' IS FLOAT
'1.000000' IS FLOAT
1.0e10 IS FLOAT
DECIMAL('1234567890123456789012345', 25,0) IS FLOAT
'number' IS NOT FLOAT
'123 456' IS NOT FLOAT
'1.0e4000' IS NOT FLOAT
Last modified date: 08/28/2024