class DecimalEncoder(json.JSONEncoder): def default(self, o): if isinstance(o, decimal.Decimal): return float(o) super(DecimalEncoder, self).default(o) j = json.dumps(jsonData,cls=DecimalEncoder)#
原文链接:https://blog.csdn.net/No1Brother_Jian/java/article/details/91346462