ValueFilter filter = new ValueFilter() {
public Object process(Object object, String name, Object value) { if(value instanceof BigDecimal || value instanceof Double || value instanceof Float){ return new BigDecimal(value.toString()).setScale(2, BigDecimal.ROUND_HALF_UP); } return value; } };
JSONArray results = JSONArray.parseArray(JSONObject.toJSONString(userList,filter));
String teString = JSON.toJSONString(jsonObject, filter, new SerializerFeature[0]);