Skip to content

DECIMAL type is returning as a number, not as a string #660

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
thallium205 opened this issue Nov 26, 2013 · 2 comments
Closed

DECIMAL type is returning as a number, not as a string #660

thallium205 opened this issue Nov 26, 2013 · 2 comments

Comments

@thallium205
Copy link

When querying a field that is of type DECIMAL in mysql, the documentation states that it will return as type String, but it actually returns as a float. This is a big issue when dealing with financial data.

@dougwilson
Copy link
Member

Hello!

Did you set the configuration "bigNumberStrings" to true when you created your connection/pool? Also, which version of this library are you using?

@thallium205
Copy link
Author

Two settings appear to need to be set in order for it to work as expected:

"bigNumberStrings": true,
"supportBigNumbers": true

Documentation may need to be updated for this.

dveeden pushed a commit to dveeden/mysql that referenced this issue Jan 31, 2023
* travis: test with Go 1.9

* travis: adjust MySQL config

Fixes mysqljs#660
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants