起因是要比对数据库中数据和模板数据是否一致,模板是excel,数据库是decimal。结果就是比对出错,解决方法就是把模板的str转换成decimal

import decimal
str="1.2"
t=decimal.Decimal("1.2000")
strde=decimal.Decimal(str)
if t==strde:
    print("sdtde==t")

else: print("sdtde!=t")

输出

sdtde==t

Process finished with exit code 0

 

相关文章:

  • 2022-02-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-25
  • 2021-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-20
  • 2021-10-07
  • 2022-01-01
  • 2022-12-23
相关资源
相似解决方案