Rounding bug wierdness, methinks!



  •  I was always lead to believe that if you multiply a whole number by another whole number, you will always get...... a whole number!

     

     

    I've been through different ways to try to replicate this, but even if I take the ex-VAT price listed on another page, and add the VAT back on, it always comes back as £71.98

    So, the question is.... am I lucky to have a 1p discount, or am I getting ripped off by 1p? You decide!!!



  • They're using 3 decimal places for the ex-VAT price.

    £24 minus VAT (at 15%) = 20.869565217391304347826086956522 or 20.869 when truncated to 3 d.p.

    20.869 * 3 +VAT =  71.99805, or 71.99 when truncated to 2 d.p. for display.

    Either they're storing the £24 or they are storing the ex-VAT price, adding VAT back in then rounding: 20.869 + VAT = 23.99935 or 24.00 when rounded to 2 d.p. Either way explains that they still show £24.00 as the individual with-VAT price.

    Even better is if they've stored the ex-VAT price as 20.868, because that totals to 71.9946 which rounds to what you see, as well as giving 23.9982 (rounds to 24.00) as the individual price. Rounds in both columns seems much more plausible to me.



  • The actual price is £23.9980 but they rounded it before displaying.

    At least that would make (some) sense.



  • TRWTF is (1) "wierdness" (2) that you're buying DDR memory.


  • Discourse touched me in a no-no place

    @Thief^ said:

    £24 minus VAT (at 15%)
    VAT is currently 17.5%. (Even to those 'advertising' 15% - all those businesses are doing is absorbing the difference.)



  •  @The_Assimilator said:

    TRWTF is (1) "wierdness" (2) that you're buying DDR memory.
    Actually I'm about to place an order for one of those. Some of us still have a couple of old PCs around you know.



  • @PJH said:

    VAT is currently 17.5%. (Even to those 'advertising' 15% - all those businesses are doing is absorbing the difference.)

    True, they changed it back.

    I've had a play on ebuyer's site, for the "Line Total" column it's definitely taking the exVAT price, multiplying it by units and VAT (real, 17.5% VAT), then rounding. The "exVAT" view (link at the top of the screen to switch) totals up fine. I'm not sure what the law demands for VAT calculation, should it be applying VAT per unit or applying VAT to the total?



  • @Thief^ said:

    @PJH said:

    VAT is currently 17.5%. (Even to those 'advertising' 15% - all those businesses are doing is absorbing the difference.)

    True, they changed it back.

    I've had a play on ebuyer's site, for the "Line Total" column it's definitely taking the exVAT price, multiplying it by units and VAT (real, 17.5% VAT), then rounding. The "exVAT" view (link at the top of the screen to switch) totals up fine. I'm not sure what the law demands for VAT calculation, should it be applying VAT per unit or applying VAT to the total?

    Last time I did any of this stuff you were allowed a 1p per line "rounding discrepancy"



  •  If it's the UK, then the rule is "Whichever way works out giving the most tax"


  • Discourse touched me in a no-no place

    @Thief^ said:

    I'm not sure what the law demands for VAT calculation, should it be applying VAT per unit or applying VAT to the total?
    Per item I believe

    If you wish to work out the VAT separately for a line of goods or services, which are included with other goods or services in the same invoice, you should calculate the separate amounts of VAT either by rounding:
    • down to the nearest 0.1p - for example, 86.76p would be rounded down to 86.7p; or
    • to the nearest 1p or 0.5p - for example, 86.76p would be rounded up to 87p.

    Whatever you decide, you must be consistent.

    The final total amount of VAT payable may be rounded down to the nearest whole penny.

  • Discourse touched me in a no-no place

    @Mole said:

     If it's the UK, then the rule is "Whichever way works out giving the most tax"

    It's not actually. And it's not the only area of tax where it applies - you round down (in your favour) in some sections of the self-assessment.



  •  Wow, I'm amazed. Something that isn't designed to extort the maximum amount possible from the public.



  • If the per item price were, with VAT, 23.996, that would display as 24.00. Multiply by 3 and you get 71.988, which would display as 71.99.

    No mystery. One case you round down, the other you round up.


  • :belt_onion:

    @DOA said:

    @The_Assimilator said:
    TRWTF is (1) "wierdness" (2) that you're buying DDR memory.
    Actually I'm about to place an order for one of those. Some of us still have a couple of old PCs around you know.
    DOA is right. I've recently added 2GB to my 5 year old Pentium 4. Windows 7 with 4GB of total memory is lightning fast.


Log in to reply