Skip to Main Content

Programming Languages & Frameworks

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

round() function not rounding

Matt M.May 27 2015 — edited May 28 2015

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

Comments

Post Details

Added on May 27 2015
1 comment
1,310 views