Skip to content

Rounding strategies and decimal place pricing #695

Description

@RaederDev

Description

Commerce incorrectly adds 1-2c to our order total even though it shouldn't.

Steps to reproduce

  1. Create products with the following prices:
    Luftpolsterfolie (4.917 EUR)
    Klebeband (1.667 EUR)
    BOX (3.75 EUR)
    Reisekoffer (8.25 EUR)
    Business-Trolley (5.75 EUR)
    Golftasche (12.417 EUR)

  2. Add a 20%, not included in price VAT tax rate.

  3. Add products to cart:
    3x BOX
    1x Reisekoffer
    1x Business-Trolley
    1x Golftasche
    1x Klebeband
    1x Luftpolsterfolie

  4. Your cart.totalPrice will now be € 53.11 even though it should be € 53.10.
    Because ((3.75 * 3) + 8.25 + 12.417 + 5.75 + (1.667 + 4.917)) * 1.2 = 53.1012

Screenshots:
https://i.imgur.com/kW5OSKG.png
https://i.imgur.com/DNPB0zX.png

This is a very big issue for us. We are essentially overcharging clients 2c that we would need to refund leading to much more complications.

Additional info

  • Craft version: Craft Pro 3.1.8
  • PHP version: 7.2.13
  • Database driver & version: MySQL 5.5.5
  • Plugins & versions: Craft Commerce | 2.0.4, Stripe for Craft Commerce 1.0.10

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions