> ## 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 formatting

> How to format prices depending on the country, style the integer and decimal parts separately, define replacement characters for zero, and disable formatting in specific places.

WEBSALE V8s supports country-dependent price formatting, for example the country-dependent display of prices with a comma or period as the decimal separator. In addition, you can define the display of prices individually.

Examples:

| Country | Possible representations |
| - | - |
| Germany | 1,234.23 EUR or € 1,234.23 |
| USA | |
| Sweden | SEK 1,234:00, with a colon as the decimal separator |

![Preis Formatierung](https://mintcdn.com/websaleag-44ee7ea6/skgEiyBpkjLxNR4u/images/preis_formatierung.jpg?fit=max\&auto=format\&n=skgEiyBpkjLxNR4u\&q=85\&s=618b3792b21a7054898ab3929087db39)

## Country-dependent price formatting

The settings are defined in the shop configuration `shop.config` in the `<PriceFormat>` section and can be changed there.

It is important to note that this only concerns the display of prices. The internal calculation of numbers is performed with higher precision, and for the transfer of numbers, the international technical format is retained. There, only one decimal separator is used, namely the period.

Example: We have a Swedish shop and the display of the price should be as follows: 1.234:99

```ini theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<PriceFormat>
   ...
   DecimalPlaces         = 2
   DecimalSeparator      = :
   ThousandsSeparator    = .
   ...
</PriceFormat>
```

Reference: Section PriceFormat&#x20;

## Formatting integer and decimal parts

Optionally, you can format the integer and decimal parts of price information differently in shape, size, and color. For this purpose, you can position the integer and decimal parts separately.

Example: You want to superscript the decimal part of the product price. To do so via styles, you must position the integer and decimal parts separately with tags on the template.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
~PR-IPart(Price)~
<span style="vertical-align: super">~PR-FPart(Price)~ ~WS-CurrencySymbol~</span>
```

Reference: PR-FPart()

Reference: PR-IPart()

Reference: BD-FPart()

Reference: BD-IPart()&#x20;

## Replacement character for zero

Optionally, you can also define a replacement character that is displayed when the integer or decimal part is 0.

Examples:

* Instead of 3.00 EUR, you can display 3.-- EUR or 3 EUR.
* Instead of 0.50 EUR, you can display .50 EUR.

### Step 1: Defining the replacement characters in the shop configuration

You define the replacement characters in your shop configuration `shop.config` in the `<PriceFormat>` section via the `ZeroIntegralPart` and `ZeroFractionalPart` parameters.

Example: Instead of 3.00, 3.-- should be displayed. Therefore we enter the value `--` after the `ZeroFractionalPart` parameter. Instead of 0.50, -.50 should be displayed. Therefore we enter the value `-` after the `ZeroIntegralPart` parameter.

```ini theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<PriceFormat>
   ZeroIntegralPart      = -
   ZeroFractionalPart    = --
</PriceFormat>
```

### Step 2: Adjusting the price tags on the templates

The display of a replacement character only works if the tags `PR-FPart()`, `BD-FPart()`, `PR-IPart()`, or `BD-IPart()` are used for the representation and display of the prices.

So if you want to have the product price `PR-Price` displayed with a replacement character in the case of a zero, replace the tag `PR-Price` on all templates as follows:

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
...
~PR-IPart(Price)~ ~PR-FPart(Price)~ ~WS-CurrencySymbol~
...
```

> [!NOTE]
>
> If you want to use prices without formatting on a template, for example as a tag parameter or for transfer to technical systems, you can temporarily disable the formatting. How to do this is described in the section [Disabling price formatting in specific places](#disabling-price-formatting-in-specific-places).

## Transferring prices to technical interfaces

All technical interfaces to ERP systems, clearing systems, tracking systems, and affiliate systems that have not been manually integrated are not affected by the formatting. These systems are provided with an internationally valid technical format for prices.

Also unaffected are the weight and volume of the product, the weight and volume of the order, VAT and discount rates, order quantities, and other numbers displayed in the shop.

Pointer: Transferring prices to external systems&#x20;

## Disabling price formatting in specific places

Once you have opted for a price formatting, this formatting is used throughout the shop for displaying prices.

In some places, however, it is necessary to display prices without formatting, for example as a tag parameter or for transfer to technical systems. In this case, you can disable the formatting with the tag `WS-DisablePriceAndNumberFormat` in that specific place and then re-enable it with the tag `WS-EnablePriceAndNumberFormat`.

Example: Using the comparison tag `DC-CompareDigitGT()`, an area should be displayed on the single product view if the product price is greater than 99.99 euros.

A comma is defined as the decimal separator. However, for the logical comparison this would mean that the price stored in the `PR-Price` tag would be interpreted as 99, because every technical system expects a period as the decimal separator. The area would therefore be displayed for every price above 99 euros.

To prevent this, the price formatting must be deactivated for this area:

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<!-- Display of a banner if the product price is greater than 99.99 euros -->

   <!-- temporarily deactivate the price formatting -->
   ~WS-DisablePriceAndNumberFormat~

   {DC-CompareDigitGT($PR-Price$,99.99)}

  <!-- Re-enable the price formatting so that the price is displayed formatted -->
      ~WS-EnablePriceAndNumberFormat~
      <!-- Display of a banner, for example free shipping -->
      ...

   {/DC-CompareDigitGT($PR-Price$,99.99)}

   <!-- Re-enable the price formatting in case the price is less than 99.99 euros -->
   ~WS-EnablePriceAndNumberFormat~
```

> [!NOTE]
>
> The technical interfaces are not affected by the formatting anyway, see the section [Transferring prices to technical interfaces](#transferring-prices-to-technical-interfaces).

Reference: WS-DisablePriceAndNumberFormat

Reference: WS-EnablePriceAndNumberFormat

Reference: DC-CompareDigitGT()&#x20;


## Related topics

- [Price calculation method](https://dokumentation.websale.de/en/v8s/preise/preisberechnungsmethode.md)
- [Prices, taxes, and currency](https://dokumentation.websale.de/en/v8s/referenz/konfigurationen/shopkonfiguration-shop-config/preise-steuern-und-waehrung.md)
- [general - General shop settings](https://dokumentation.websale.de/en/konfiguration/general-allgemeine-shopeinstellungen.md)
- [finance - Currencies & taxes](https://dokumentation.websale.de/en/konfiguration/finance-wahrungen-steuern.md)
- [EJD- (JSON interface)](https://dokumentation.websale.de/en/v8s/referenz/tags/ejd.md)


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