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

Fixing PostgreSQL BigDecimal conversion problems #781

Merged
merged 3 commits into from
Nov 5, 2020

Conversation

pimeys
Copy link
Contributor

@pimeys pimeys commented Oct 30, 2020

This test fails. Expecting 0.01, got 0.

@pimeys
Copy link
Contributor Author

pimeys commented Oct 30, 2020

Added a fix too, that borrows from the rust_decimal conversion, and seems to convert values such as 0.01 correctly.

@pimeys
Copy link
Contributor Author

pimeys commented Oct 30, 2020

Maybe @abonander could take a look and see if this makes any sense?

@pimeys pimeys changed the title A test to reveal a bug with BigDecimal and PostgreSQL Fixing PostgreSQL BigDecimal conversion problems Oct 30, 2020
Now working properly with numbers, such as `0.01` and `0.012`.
@abonander
Copy link
Collaborator

I don't really have the brain cycles to go through the math but the added test cases proves well enough to me that it's more correct than what was there before. Thanks!

@abonander abonander merged commit a0007b4 into launchbadge:master Nov 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants