我遇到的问题是我将结果四舍五入到小数点后两位.我的应用程序获得了正确的结果,但是,我很难将应用程序舍入到最接近的小数,就像使用货币一样
cost = input("\nEnter the 12 month cost of the Order: ")
cost = float(cost)
print("\n12 Month Cost:",
  cost * 1,"USD")
print("6 Month Cost:",
  cost * 0.60,"USD")
print("3 Month Cost:",
  cost * 0.36,"USD")
所以例如,如果12个月的价格是23美元,6个月的价格是13.799999999999999但我希望它显示13.80
我已经环顾了谷歌以及如何围绕一个数字,但在舍入结果方面找不到多少帮助.