ToDouble
This reference topic applies to FQL v4. Go to this page for the latest FQL v10 reference topics. |
ToDouble( value )
to_double( value )
ToDouble( value )
ToDouble( value )
ToDouble( value )
ToDouble( value )
Description
The ToDouble
function converts a value to a double-precision numeric
value, if possible.
Attempting to convert a value to a double-precision numeric value which has no numeric representation results in an "invalid argument" error.
Host languages have varying support for double-precision numeric
values. Within Fauna, double-precision numeric values are
stored and operated on as 64-bit, IEEE 754, double-precision float
values. The host language you use may affect how the result of
ToDouble can be interpreted.
|
Parameters
Parameter | Type | Definition and Requirements |
---|---|---|
|
Any |
The value to attempt to convert to a double-precision numeric value. |
Examples
The following query calls ToDouble
multiple times to demonstrate
variations on the kinds of values that ToDouble
accepts:
[ 1234.5678, 1234, 123.456789, 0 ]
[1234.5678, 1234.0, 123.456789, 0.0]
[1234.5678 1234 123.456789 0]
Arr(DoubleV(1234.5678), DoubleV(1234), DoubleV(123.456789), DoubleV(0))
[1234.5678, 1234.0, 123.456789, 0.0]
[ 1234.5678, 1234, 123.456789, 0 ]