• Resolved aLjaz

    (@aljaz)


    Hi,

    On github i posted a question about the issue of woocommerce not rounding the prices in proper way. Bellow it is the description of the issue.

    Example of issue:
    Product: 1.99€ (this already includes tax calculation)

    If i add this to cart and say i want 5 pieces of this product the expected price would be: 9.95€, but the cart actually outputs: 9.94€ which is not fine. I did manualy calculation and it makes sesnse why this number comes out as mentioned the system is calculating everything on 4 decimals.
    That would mean:

    Net price of product: 1.63
    22% tax: 0.3586
    Total price display: 1.99 as sytem calculates 1.9886 and rounds it up to 1.99
    But then it also calculates the quantity by price 1.9886 instead of 1.99, why ?

    So 2×1.9886 = 3.9772€ and round to 3.98€ which is same as 2×1.99 = 3.98
    But on different prices the different quantity doesn’t work, for example:
    5×1.9886 = 9,943 and it rounds to disply price 9.94€, now if you take 5×1.99 the price should be 9.95€.

    Is it somehow possible to force the whole system to only work with 2 or 3 decimals, like the display option ?
    How can i resolve this issue in system ? Thanks in advance.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Damianne P (a11n)

    (@drwpcom)

    Hi @aljaz. As discussed in the Github issue, checkout prices are calculated using the price entered, so in this case $1.63 as follows:

    If you want to use $1.99 as the final price for each product, then it’s best to enter in the prices including tax, in which case you will get the desired result as followed:

    The system is working with 2 decimal places as specified, but will calculate the totals based on the price entered, either with or without tax.

    So without tax:
    $1.63 entered as product price
    Price of 5 products: $8.15
    Tax: $1.79 (8.15*0.22)
    Total: $9.94

    With tax:
    $1.99 entered as product price
    Price of 5 products: $9.95
    Tax: $1.79 (9.95 – (9.95/1.22))

    AJ a11n

    (@amandasjackson)

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Price rounding’ is closed to new replies.