• Resolved v3media

    (@v3media)


    When calculating totals in the cart, something is definitely not rounding correctly. When displaying 2 decimal places, this is the result we are getting:

    Subtotal: $1.99
    Shipping: $8.50
    5% GST : $0.52
    7% PST : $0.73
    TOTAL : $11.75

    Doing that same transaction with 4 decimal places, it’s clear that the 5% GST is not rounding properly. It’s ignoring the last decimal place (or 2)…

    Subtotal: $1.9900
    Shipping: $8.5000
    5% GST : $0.5245
    7% PST : $0.7343
    TOTAL : $11.7488

    Has anyone else come across this? (and hopefully come up with a fix?)

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Hannah S.L.

    (@fernashes)

    Automattic Happiness Engineer

    Hey there,

    Thanks for those examples!

    When you’ve set the GST under WooCommerce > Settings > Taxes, have you set it with 4 decimal points, i.e. 5.0000%?

    Thread Starter v3media

    (@v3media)

    Hi Hannah. Yes, I can confirm that all taxes have 4 decimal places.

    Also for comparison, I also did another test using the same numbers but a different destination that is only subject to 1 of the taxes and the result was proper calculations:

    Subtotal: $1.99
    Shipping: $8.50
    5% GST : $0.52
    TOTAL : $11.01

    Subtotal: $1.9900
    Shipping: $8.5000
    5% GST : $0.5245
    TOTAL : $11.0145

    Thread Starter v3media

    (@v3media)

    Also, just to update this, we’ve tested removing all plugins except for Woocommerce and the results are identical.

    Thread Starter v3media

    (@v3media)

    We’re stuck here and unable to launch the site with this bug.

    Has nobody in Canada (or any other dual tax country) run into this before? Can anyone offer any ideas or clues as to where we can find the code that would do this in the digital maze?

    Thread Starter v3media

    (@v3media)

    This IS a known bug…

    https://github.com/woocommerce/woocommerce/issues/21871

    In the meantime, if you round taxes at the subtotal level under the WooCommerce > Settings > Tax tab, that should correct the issue.

    jessepearson

    (@jessepearson)

    Automattic Happiness Engineer

    Setting this thread to resolved since the GitHub issue is open, no need for both to be open.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Tax Calculations not rounding properly’ is closed to new replies.