strongloop / strong-oracle

Deprecated: Node.js Driver for Oracle databases (Use https://github.com/oracle/node-oracledb instead)
Other
45 stars 18 forks source link

Number type with high precision loses precision in Javascript #63

Closed alandotcom closed 4 years ago

alandotcom commented 8 years ago

I ran these tests and they passed.

https://github.com/strongloop/strong-oracle/compare/master...lumberj:lost-precision?expand=1

The issue is that some numbers cannot be expressed in JS, for example these numbers with 16 significant digits

console.log( 88259496234518.57 );    // 88259496234518.56
console.log( -707422234799.9383 );   // -707422234799.9384
alandotcom commented 8 years ago

node-oracle-db allows fetching number columns as strings, https://github.com/oracle/node-oracledb/blob/master/doc/api.md#propdbfetchasstring

And node-mysql https://github.com/felixge/node-mysql#string

And node-postgres https://github.com/brianc/node-postgres/blob/2a04d9267b30cfc7f085c9c5f9826f6a28bbb266/NEWS.md#v200

Can there be similar behavior in strong-oracle?