Skip to content
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

Returing float for decimal types with MsSql #9353

Closed
abacha opened this issue Apr 25, 2018 · 2 comments
Closed

Returing float for decimal types with MsSql #9353

abacha opened this issue Apr 25, 2018 · 2 comments
Labels
breaking change For issues and PRs. Changes that break compatibility and require a major version increment. type: bug
Milestone

Comments

@abacha
Copy link

abacha commented Apr 25, 2018

Using sequelize connecting to a SQL Server database

sequelize: 4.37.6
tedious: 2.0.0

I've created a model with a DECIMAL field:

net_value: {
  type: data_types.DECIMAL
}

And when I render it on my controller, its being parsed to float

[
  {
    ...
    "net_value": 28142.030000000002,
    ...
  }
]
@sushantdhiman sushantdhiman added type: bug breaking change For issues and PRs. Changes that break compatibility and require a major version increment. labels Apr 29, 2018
@sushantdhiman
Copy link
Contributor

Just like MySQL / Postgres, MSSQL / SQLite should return decimal values as string to preserve precision

@sushantdhiman sushantdhiman added this to the v5 milestone Apr 29, 2018
@sushantdhiman
Copy link
Contributor

tedious driver does not support this tediousjs/tedious#163, so we can;t implement this change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change For issues and PRs. Changes that break compatibility and require a major version increment. type: bug
Projects
None yet
Development

No branches or pull requests

2 participants