-
Notifications
You must be signed in to change notification settings - Fork 43
Describe how decimals are encoded in the binary protocol #992
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
Comments
The first byte in the BCD array may have only the second digit. A An example: decimal
Another example: decimal
|
@sergepetrenko Could you clarify the difference between nibble codes? For example, when should a negative number be packed with |
@rybakit
DecNumber package itself uses preferred values: |
From a connector's perspective, does this mean that only |
decNumber uses only |
The encoding was introduced in this commit. The information how decimals are encoded in the binary protocol is important for connectors developers.
Cited from the commit message:
MsgPack spec defines
fixext 1/2/4/8/16
andext 8/16/32
types.fixext
types have fixed length, so it is not encoded explicitly, whileext
types require to encode a data length. MP_EXP + optional length meant usage of one of those types.MP_DECIMAL is 1.
I don't know how exactly PackedDecimal is encoded. @sergepetrenko, can you share more info?
The text was updated successfully, but these errors were encountered: