Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
price + tax rounding
#9
(Sep-20-2019, 09:31 PM)mlieqo Wrote: No it's not 689.88, because 344.94 is a price with tax. If I want to calculate a total price:
285.07 * 2 * 1.21
That's no the same as you posting 344.94 * 2 and it can not be round to 689.88 without cheating as explained.
>>> n = 285.07 * 2 * 1.21
>>> n
689.8693999999999

>>> round(n, 3)
689.869
>>> round(n, 2)
689.87
>>> round(n, 1)
689.9
There are basic rules of rounding you can try online Rounding Numbers Calculator .
Reply


Messages In This Thread
price + tax rounding - by mlieqo - Sep-20-2019, 04:14 PM
RE: price + tax rounding - by metulburr - Sep-20-2019, 05:57 PM
RE: price + tax rounding - by mlieqo - Sep-20-2019, 07:00 PM
RE: price + tax rounding - by metulburr - Sep-20-2019, 07:32 PM
RE: price + tax rounding - by mlieqo - Sep-20-2019, 07:53 PM
RE: price + tax rounding - by snippsat - Sep-20-2019, 09:01 PM
RE: price + tax rounding - by navidmo - Sep-20-2019, 09:19 PM
RE: price + tax rounding - by mlieqo - Sep-20-2019, 09:31 PM
RE: price + tax rounding - by snippsat - Sep-20-2019, 10:01 PM
RE: price + tax rounding - by mlieqo - Sep-20-2019, 10:12 PM
RE: price + tax rounding - by DeaD_EyE - Sep-21-2019, 01:52 PM
RE: price + tax rounding - by mlieqo - Sep-21-2019, 04:53 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  need help rounding joseph202020 7 1,389 Feb-21-2023, 08:13 PM
Last Post: joseph202020
  from numpy array to csv - rounding SchroedingersLion 6 2,284 Nov-14-2022, 09:09 PM
Last Post: deanhystad
  Finding the price based on industry and number of transactions chandramouliarun 0 928 Jul-26-2022, 07:36 PM
Last Post: chandramouliarun
  class - calculate total price of copies 3lnyn0 1 1,592 Dec-12-2021, 11:43 PM
Last Post: BashBedlam
  Random data generation sum to 1 by rounding juniorcoder 9 3,531 Oct-20-2021, 03:36 PM
Last Post: deanhystad
  Rounding issue kmll 1 1,445 Oct-08-2021, 10:35 AM
Last Post: Yoriz
Exclamation Invalid syntax error(Predict Ethereum Price) lulu43366 2 3,208 Sep-24-2021, 01:24 PM
Last Post: lulu43366
  Not rounding to desired decimal places? pprod 2 2,603 Mar-05-2021, 11:11 AM
Last Post: pprod
  Decimal Rounding error project_science 4 2,802 Jan-06-2021, 03:14 PM
Last Post: project_science
  An important question is how to create a zigzag in price data? epsilon 0 1,326 Nov-18-2020, 08:06 PM
Last Post: epsilon

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020