Guest User

Untitled

a guest
Dec 15th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. from decimal import Decimal
  2.  
  3. product_cost = 88.40
  4. commission_rate = 0.08
  5. qty = 450
  6.  
  7. product_cost += (commission_rate * product_cost)
  8. print(product_cost * qty) # 95.47200000000001
  9.  
  10. product_cost = Decimal(88.40)
  11. commission_rate = Decimal(0.08)
  12. qty = 450
  13.  
  14. product_cost += (commission_rate * product_cost)
  15. print(product_cost * qty) # 117.8666666666666726100605918
Add Comment
Please, Sign In to add comment