Purpose
TO_BINARY_DOUBLE() returns a double-precision floating-point number.
Note
The conversion from a string or a value of the NUMBER type to a value of the BINARY_DOUBLE type may not be accurate, because the string and NUMBER types use decimal precision, while BINARY_DOUBLE uses binary precision. The conversion from BINARY_FLOAT to BINARY_DOUBLE is accurate.
Syntax
TO_BINARY_DOUBLE(expr [, fmt [, 'nlsparam' ] ])
Parameters
| Parameter | Description |
|---|---|
| expr | A string or value of the NUMBER, BINARY_FLOAT, or BINARY_DOUBLE data type. |
| fmt | The format of the return value. This parameter is optional. If you do not specify fmt, n is converted to a VARCHAR2 value. For information about values for fmt, see “Values for fmt”. |
| nlsparam | The decimal character, group separator, local currency symbol, and international currency symbol. This parameter is optional. |
Note
The optional fmt and nlsparam parameters take effect only when expr is a string. They serve the same purpose as for TO_CHAR(number). When expr is BINARY_DOUBLE, the function returns expr.
Return type
The return type is BINARY_DOUBLE.
Examples
The following example converts 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