在Newtonsoft.Json中保留删除尾随零 [英] Preserve remove trailing zeros in Newtonsoft.Json
本文介绍了在Newtonsoft.Json中保留删除尾随零的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的C#应用程序中的Newtonsoft.JsonConverter有问题. 我有带尾随零的十进制. 转换为json后-缺少零.
I have problem with Newtonsoft.JsonConverter in my C# app. I have decimal with trailing zeros. After convert to json - there zeros are missing.
示例:
input (decimal): 1.99000
output (json): 1.99
我有自己的转换器,该转换器处理十进制值. 另外,我将FloatParseHandling配置为十进制.
I have my own converter, that handles decimal value. Also, I configured FloatParseHandling as decimal.
我该怎么做才能保留此过程?
What can I do to preserve this process?
推荐答案
This was a bug introduced in Json.NET 10.0.1 and reported here. It has since been fixed in 11.0.1.
这篇关于在Newtonsoft.Json中保留删除尾随零的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文