The problem I am facing comes down to rounding my results to two decimal places. My application gets the correct results, however, I have difficulty rounding the application to the nearest decimal, as with the currency
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")
so, for example, if the 12-month price is $ 23, the price for 6 months is 13.799999999999999, but I want it to show 13.80
I looked at google and how to round a number, but could not find much help in rounding the result.
source share