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).
40214021##### <a name="numberhandling"></a> 9.1.6.2 Fetching Numbers
40224022
40234023By default all numeric columns are mapped to JavaScript numbers.
4024+ Node.js uses double floating point numbers as its native number type.
40244025
40254026When numbers are fetched from the database, conversion to JavaScript's
40264027less precise binary number format can result in "unexpected"
@@ -4044,12 +4045,18 @@ purely in Node.js, for example:
40444045console .log (0.2 + 0.7 ); // gives 0.8999999999999999
40454046` ` `
40464047
4048+ Node.js can also only represent numbers up to 2 ^ 53
4049+ which is 9007199254740992. Numbers larger than this will be truncated.
4050+
40474051The primary recommendation for number handling is to use Oracle SQL or
40484052PL/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
40504056` fetchInfo` (see [below](#fetchasstringhandling)) to fetch numbers in
40514057string 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.
40534060
40544061##### <a name="datehandling"></a> 9.1.6.3 Fetching Dates and Timestamps
40554062
You can’t perform that action at this time.
0 commit comments