Purpose
You can call this function to return a double-precision floating-point number.
Note
The conversion from a string or a value of the
NUMBERdata type to a value of theBINARY_DOUBLEdata type may not be accurate, because the string andNUMBERdata types use decimal precision, whileBINARY_DOUBLEuses binary precision. The conversion fromBINARY_FLOATtoBINARY_DOUBLEis 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
fmtandnlsparamparameters take effect only whenexpris a string. They serve the same purpose as forTO_CHAR(number). WhenexprisBINARY_DOUBLE, the function returnsexpr.
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