我正在将JSON转换为XML,并在使用newtonsoft json库对XML进行一些数据处理后再次转换为JSON。在此过程中,我丢失了数值。它转换为字符串值。我的JSON数据包格式不固定,因为它来自其他来源,因此无法创建JSON数据包的数据类型类。
原始JSON
{
"MCCDailyPlanLimitCount": null,
"MCCDailyPlanLimitAmount": "500.01",
"MCCMonthlyPlanLimitCount": 31,
"MCCMonthlyPlanLimitAmount": "3000.01",
"MCCWeeklyPlanLimitCount": 8,
"MCCWeeklyPlanLimitAmount": "2000.01"
}
转换后的JSON
{
"MCCDailyPlanLimitCount": null,
"MCCDailyPlanLimitAmount": "500.01",
"MCCMonthlyPlanLimitCount": "31",
"MCCMonthlyPlanLimitAmount": "3000.01",
"MCCWeeklyPlanLimitCount": "8",
"MCCWeeklyPlanLimitAmount": "2000.01"
}