We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
fastjson缺省反序列化带小数点的数值类型为BigDecimal,因为在真实的业务中,float/double表示的二进制精度和直观理解的十进制精度不太一样。但还是存在使用float/double而不是BigDecimal的场景。
JSON.DEFAULT_PARSER_FEATURE &= ~Feature.UseBigDecimal.getMask();
int disableDecimalFeature = JSON.DEFAULT_PARSER_FEATURE & ~Feature.UseBigDecimal.getMask(); String json = "...."; Class type = JSONObject.class; JSON.parseObject(json, type, disableDecimalFeature);