> ## Documentation Index
> Fetch the complete documentation index at: https://dokumentation.websale.de/llms.txt
> Use this file to discover all available pages before exploring further.

# Price calculation method

WEBSALE V8s calculates all prices and totals internally with a higher precision than they are displayed by default. As a result, prices and totals may appear different than expected to the buyer. This happens, for example, when internal price data is available with higher precision than what is displayed due to the price formatting, or as a result of various calculations such as percentage discounts.

It is therefore important to configure WEBSALE V8s to use rounded subtotals so that price information is transparent for the customer.

## Example without rounded subtotals

Product A costs 10.004 EUR, product B costs 20.203 EUR. The buyer places one item each of product A and product B in the cart, in which the total calculation is displayed as follows:

| Item | Amount |
| - | - |
| 1x Product A | 10.00 EUR |
| 1x Product B | 20.20 EUR |
| Total | 30.21 EUR |

The total is displayed as 30.21 EUR because the calculation is performed with higher precision than the display:

```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
10.004 + 20.203 = 30.207
```

Rounded to 2 decimal places, this gives 30.21.

## Example with rounded subtotals

To prevent this effect, you can configure WEBSALE V8s to round subtotals before performing further calculations with them.

The buyer again places one item each of product A and product B in the cart. Rounded subtotals with a precision of 2 decimal places are used. The buyer sees the cart as follows:

| Item | Amount |
| - | - |
| 1x Product A | 10.00 EUR |
| 1x Product B | 20.20 EUR |
| Total | 30.20 EUR |

Subtotals rounded to two decimal places are used. Therefore, the total is calculated as follows:

```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
(10.004 rounded to 10.00) + (20.203 rounded to 20.20) = 10.00 + 20.20 = 30.20
```

## Configuration

For all numbers that represent prices, you should therefore define the rules for rounded subtotals in addition to the display formatting. You make this setting in the `<OrderConditions>` section of the shop configuration `shop.config`.

```ini theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<OrderConditions>
   ...
   RoundedSubTotals-Allow     = yes      # Commercial rounding according to DIN 1333
   RoundedSubTotalsPrecision  = 2        # Decimal places to round to
   ...
</OrderConditions>
```

Reference: Configuration shop.config, section OrderConditions&#x20;

## Scope of the price formatting

Price formatting is applied throughout:

* on all HTML pages. This applies to all tags that display prices and to all elements automatically generated by WEBSALE V8s, such as the cart total, the tiered price table, and the reduced price.
* in all emails.


## Related topics

- [Prices and costs](https://dokumentation.websale.de/en/v8s/preise/preise-und-kosten.md)
- [Prices, taxes, and currency](https://dokumentation.websale.de/en/v8s/referenz/konfigurationen/shopkonfiguration-shop-config/preise-steuern-und-waehrung.md)
- [VAT](https://dokumentation.websale.de/en/v8s/preise/mehrwertsteuer.md)
- [Payment, shipping and order completion](https://dokumentation.websale.de/en/v8s/referenz/tags/ws/zahlung-versand-und-bestellabschluss.md)
- [finance - Currencies & taxes](https://dokumentation.websale.de/en/konfiguration/finance-wahrungen-steuern.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.