File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -4021,6 +4021,7 @@ Type Notes](#binddatatypenotes).
4021
4021
##### <a name="numberhandling"></a> 9.1.6.2 Fetching Numbers
4022
4022
4023
4023
By default all numeric columns are mapped to JavaScript numbers.
4024
+ Node.js uses double floating point numbers as its native number type.
4024
4025
4025
4026
When numbers are fetched from the database, conversion to JavaScript's
4026
4027
less precise binary number format can result in "unexpected"
@@ -4044,12 +4045,18 @@ purely in Node.js, for example:
4044
4045
console .log (0.2 + 0.7 ); // gives 0.8999999999999999
4045
4046
` ` `
4046
4047
4048
+ Node.js can also only represent numbers up to 2 ^ 53
4049
+ which is 9007199254740992. Numbers larger than this will be truncated.
4050
+
4047
4051
The primary recommendation for number handling is to use Oracle SQL or
4048
4052
PL/SQL for mathematical operations, particularly for currency
4049
- calculations. Alternatively you can use ` fetchAsString` or
4053
+ calculations.
4054
+
4055
+ To reliably work with numbers in Node.js, use ` fetchAsString` or
4050
4056
` fetchInfo` (see [below](#fetchasstringhandling)) to fetch numbers in
4051
4057
string format, and then use one of the available third-party
4052
- JavaScript number libraries that handles more precision.
4058
+ JavaScript number libraries that handles large values and more
4059
+ precision.
4053
4060
4054
4061
##### <a name="datehandling"></a> 9.1.6.3 Fetching Dates and Timestamps
4055
4062
You can’t perform that action at this time.
0 commit comments