-
Notifications
You must be signed in to change notification settings - Fork 79
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
Option to JSON encode Decimal types as numbers, not strings #440
Comments
In the future I'd expect to make the encoding of Encoding decimals as strings makes it easier for downstream consumers of the JSON to properly load decimal objects without losing precision. Most JSON libraries (both in Python and in other languages) don't support hooking into the parsing process for numbers ( For example, using |
Brilliant, thank you for looking into the use case for this and raising a new issue. I agree with you that outputting as a string can avoid downstream issues including truncation / rounding, we have certainly seen this issue. In some situations we wish to treat decimals as decimals, so the option to make this configurable sounds like a good path forward. Thank you for you efforts in producing this package. |
Originally posted by @s7clarke10 in #349 (comment)
The text was updated successfully, but these errors were encountered: