Skip to content

BUG Random number format 2.3000000000000003 #1213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
andriusphoto opened this issue Feb 24, 2020 · 3 comments
Closed

BUG Random number format 2.3000000000000003 #1213

andriusphoto opened this issue Feb 24, 2020 · 3 comments

Comments

@andriusphoto
Copy link

andriusphoto commented Feb 24, 2020

Hi,
when we try to pass the number 2.3 to the database function, the function gets 2.3000000000000003, so it doesn't happen with all the numbers, if we send 2.2 then we get 2.2

  public execute(query: string, bindParams: oracledb.BindParameters = {}, options: oracledb.ExecuteOptions = {}) {
    return this._connection.execute(query, bindParams, options)
  }

NLS_DATE_FORMAT=YYYY-MM-DD HH24:MI:SS;
NLS_LANG=LITHUANIAN_LITHUANIA.BLT8MSWIN1257;
NLS_NUMERIC_CHARACTERS=.,
ORA_SDTZ=UTC;

process.platform = linux
process.version = v12.16.1
process.arch = x64
require('oracledb').versionString 4.2
require('oracledb').oracleClientVersionString 18.3.0.0.0

Oracle Database version: Oracle Database 12c Standard Edition Release 12.1.0.2.0 - 64bit Production

@danilohgds
Copy link

danilohgds commented Feb 24, 2020

I dont think this is a bug... most likely mishandling of floating points...are you using any libraries like bignumber.js?

@anthony-tuininga
Copy link
Member

Agreed. This is not a bug. See issue #793 for more information.

@andriusphoto
Copy link
Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants