nukedzn / node-informix

A node.js native client for IBM Informix
18 stars 10 forks source link

Decimal numbers #37

Closed leosurban closed 7 years ago

leosurban commented 7 years ago

Decimal numbers are returned as integer.

Correct result with DBACCESS:

echo select cismater, cenamj from cenmat where nazevmater like 'AR%' | dbaccess pemaxdb

Database selected. cismater cenamj MAT026501147 7.964439875659 6550-0050-00 138.560000000000 0120205446 5.520000000000 0120202220 5.200000000000 0120196149 5.256000000000 0120208002 33.600000000000 0120208126 93.600000000000 7 row(s) retrieved. Database closed.

And node-informix: [ [ 'MAT026501147', 7 ], [ '6550-0050-00', 138 ], [ '0120205446 ', 5 ], [ '0120202220 ', 5 ], [ '0120196149 ', 5 ], [ '0120208002 ', 33 ], [ '0120208126 ', 93 ] ]

var opts = {
  database : 'pemaxdb@ixlur',
  username : 'informix',
  password : '***'
}; 
var informix = require( 'informix' )( opts );
informix
  .query( "select cismater, cenamj from cenmat where nazevmater like 'AR%';" )
  .then( function ( cursor ) 
  {
    return  cursor.fetchAll();

  } )
  .then( function ( results )
  {
     console.log( results );
  })
  .catch( function ( err ) 
  {
    console.log( err );
  } );
uatuko commented 7 years ago

Fixed in v0.5.5.