Purpose
This function returns a double-precision floating-point number.
Note
Conversions from a NUMBER or a character value to a BINARY_DOUBLE may not be accurate because NUMBER and character types use decimal precision to represent numbers, whereas BINARY_DOUBLE uses binary precision. Conversions from a BINARY_FLOAT to a BINARY_DOUBLE are accurate.
Syntax
TO_BINARY_DOUBLE(expr [, fmt [, 'nlsparam' ] ])
Parameters
Parameter |
Description |
|---|---|
| expr | A number of the NUMBER, BINARY_FLOAT, or BINARY_DOUBLE data type, or a string. |
| fmt | An optional output format parameter. If you omit fmt, then n is converted to a VARCHAR2 value. For more information, see the description of the fmt parameter. |
| nlsparam | An optional parameter that defines the decimal character, group separator, local currency symbol, and international currency symbol. |
Note
If expr is a string, then the optional fmt and nlsparam parameters are effective. They function the same way as the TO_CHAR (number) function. If expr is a BINARY_DOUBLE, then this function returns expr.
Return type
The function returns a value of the BINARY_DOUBLE data type.
Examples
Convert the string 123.123 to a double-precision floating-point number.
obclient> SELECT TO_BINARY_DOUBLE('123.123') FROM DUAL;
+-----------------------------+
| TO_BINARY_DOUBLE('123.123') |
+-----------------------------+
| 1.23123E+002 |
+-----------------------------+
1 row in set
