-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Number exceeds maximum value using rust_decimal. #666
Comments
What is the value of the number, please? |
It seems to occur at multiple values, one of them is |
That's pretty close to the precision limit, extra trailing zeros from the base-10000 wire representation might be pushing it over. We can work on this, but keep in mind that |
Yes, I know that the |
This is likely because we deal with the number in base-100 after decoding from the wire protocol so its precision may be extended to the next even power of 10. We probably need to divide the value by 10 to get rid of superfluous trailing zeroes. |
Rust-decimal also has a limit for scale that is 28. You can't go over that. Maybe consider using bigdecimal instead? |
Is there a workaround for this atm? Currently hitting it, |
any recommended solutions here other than using BigDecimal? I was able to confirm this is happening due to the trailing zeroes. |
@aradhya-variational-io my workaround was to just use |
I'm using sqlx (Postgres) with the
rust_decimal
crate (see #456) and got the errorNumber exceeds maximum value that can be represented
. The number was stored in aDecimal
before insertion into the database without any problems. Here is the relevant stack backtrace:The text was updated successfully, but these errors were encountered: