• yetAnotherUser@discuss.tchncs.de
    link
    fedilink
    arrow-up
    1
    ·
    17 hours ago

    No?

    Say there is a tax of x and someone purchases both a and b.

    The total would be:

    total = x * (a + b)
          = x * a + x * b
    

    As long as all items result in an amount that doesn’t have to be rounded if purchased individually then the combined amount will not have to be rounded either.

    • NotMyOldRedditName@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      16 hours ago

      When you do %'s on totals you’ll get something like $11.553

      Which is fine for a single item, they’ll round that down to $11.55 but when you start combining them, you’re off. You don’t round individual items or you can be off by a lot, you round the final one (edit: or maybe they truncate it I don’t know).

      • yetAnotherUser@discuss.tchncs.de
        link
        fedilink
        arrow-up
        1
        arrow-down
        1
        ·
        16 hours ago

        Ah, we’re both right.

        I assumed that the tax would result in whole numbers but upon further inspection (i.e. trying it out it in a calculator) it turns out that few prices would result in values that don’t have overhanging millidollars.

        The solution is obviously to force prices to be whole dollar and to further allow sale taxes only in increments of 5%.

        • NotMyOldRedditName@lemmy.world
          link
          fedilink
          arrow-up
          2
          ·
          edit-2
          14 hours ago

          The solution is obviously to force prices to be whole dollar

          My inner child died a little, knowing there are no 1c candies from my past in your future.