杰克逊版本:2.0.2
String jsonString = "{\"data\":10000000.00, \"data2\" : 0E-7}";
ObjectMapper mapper = new ObjectMapper();
mapper.enable(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS);
JsonNode jsonNode = mapper.readTree(jsonString);
System.out.println(jsonNode.toString());
System.out.println(new ObjectMapper().readTree(jsonString));
我收到以下回复
{"data":10000000.00,"data2":0E-7}
{"data":1.0E7,"data2":0.0}
我能做些什么来获得输出 { “数据”:10000000.00,“数据2” :0.0}