Preserve remove trailing zeros in Newtonsoft.Json

这一生的挚爱 提交于 2019-12-24 11:12:00

问题


I have problem with Newtonsoft.JsonConverter in my C# app. I have decimal with trailing zeros. After convert to json - there zeros are missing.

Example:

input (decimal): 1.99000
output (json): 1.99

I have my own converter, that handles decimal value. Also, I configured FloatParseHandling as decimal.

What can I do to preserve this process?


回答1:


This was a bug introduced in Json.NET 10.0.1 and reported here. It has since been fixed in 11.0.1.



来源:https://stackoverflow.com/questions/46684557/preserve-remove-trailing-zeros-in-newtonsoft-json

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!