Skip to content

Incorrect rounding when product price is entered more than 2dp #24184

@grig-23

Description

@grig-23

Describe the bug

When the product price is 30.82500 and it's entered "exclusive tax" - 20% tax rate should be rounding it to 36.99 but it is rounded to 37 if Round tax at subtotal level, instead of rounding per line checkbox is un-ticked.

If the Round tax at subtotal level, instead of rounding per line checkbox is ticked - the product price is correct, but "subtotal" and "total" are incorrect.

To Reproduce
Steps to reproduce the behavior:

  1. Create a product with the price of 30.82500
  2. Add a 20% tax rate
  3. In WooCommerce >> Settings >> Tax set Prices entered with tax to No, I will enter prices exclusive of tax and both Display prices in the shop Display prices during cart and checkout to Including tax. Display tax totals is as a single total.

With Rounding checkbox un-ticked this is the checkout page:

Screenshot 2019-07-17 at 19 06 32

With Rounding checkbox ticked this is the checkout page:

Screenshot 2019-07-17 at 19 07 18

Expected behavior
In both cases the price should be 36.99, not 37

Might be related to #23835 and #23694

Isolating the problem (mark completed items with an [x]):

  • I have deactivated other plugins and confirmed this bug occurs when only WooCommerce plugin is active.
  • This bug happens with a default WordPress theme active, or Storefront.
  • I can reproduce this bug consistently using the steps above.

WordPress Environment

``` Copy and paste the system status report from **WooCommerce > System Status** in WordPress admin. ```

Metadata

Metadata

Assignees

Labels

CheckoutIssues related to checkout page.TaxIssues related to taxes.status: in progressThis is being worked on.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions