[CSHARP-4791] Driver unable to deserialise valid decimal values Created: 18/Sep/23 Updated: 26/Sep/23 Resolved: 26/Sep/23 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Unknown |
| Reporter: | Rhys Bevilaqua | Assignee: | Oleksandr Poliakov |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Documentation Changes Summary: | 1. What would you like to communicate to the user about this feature? |
| Description |
| Comments |
| Comment by Oleksandr Poliakov [ 26/Sep/23 ] | |
|
The root cause of the problem is the fact that MongoDB uses Double as default floating point data type. It means your example is a little more complex then just parsing decimal. DecimalSerializer doing the following operations: As the result serializer detects that converted result was truncated with comparing to the originally read data and throw the exception. To make it work more predictable you can choose one of the following:
I hope this makes sense. I'll close the ticket, but feel free to reopen it if you have more questions related to the problem or will require further assistance. | |
| Comment by PM Bot [ 18/Sep/23 ] | |
|
Hi rhys.bevilaqua@vetdb.com, thank you for reporting this issue! The team will look into it and get back to you soon. |