Forum Stats

  • 3,873,414 Users
  • 2,266,559 Discussions
  • 7,911,525 Comments

Discussions

round() function not rounding

Matt M.
Matt M. Member Posts: 9
edited May 28, 2015 9:11PM in Node.js

Hi folks,

I have  a query like this I'm trying to execute with the nodejs driver:

SELECT

  ROUND(ACT_DOLLARS,2) AS "actualDollars"

FROM mytable

WHERE charge_no = 'charge123'

ORDER BY year;

When I execute the query in a database client, in this case SQL Developer, I get the following result:

actualDollars=36524.27

When I run it through the node driver I get the following:

actualDollars=36524.270000000004

Any ideas?

If it helps, the table is defined like this:

ACT_DOLLARS NUMBER

YEAR VARCHAR2(4 BYTE)


Many thanks!

-Matt

Answers