Rounding Rules

Configure rounding rules per country through the SFCC Business Manager.

Rounding Prices

The ESW-SFCC cartridge enables merchants to control how prices are displayed across the storefront, shopping cart, and ESW Checkout by configuring the ESW Rounding Rules.

These rules apply only to countries and currencies that use the Calculated Pricing Model.

Implement Rounding Rules

Rounding behavior is configured within Salesforce B2C Commerce Business Manager. To define or modify rounding rules:

Navigate to Merchant Tools → Custom Objects → Custom Object Editor → ESW_PA_DATA → ESW Rounding Rules

Once configured, these rules will be applied automatically to all prices calculated via the ESW Pricing Advisor, ensuring consistent price presentation across the shopper journey.

How Rounding Rules Are Applied

The ESW Rounding Rules are automatically applied to the appropriate country and currency after the retailerPricingFeed job is executed.

Below is a sample payload structure illustrating how rounding rules are assigned per country and currency:

{
  "deliveryCountryIso": "GB",
  "roundingModels": [
    {
      "currencyIso": "GBP",
      "currencyExponent": 2,
      "direction": "Up",
      "model": "none.fixed99"
    }
  ]
},
{
  "deliveryCountryIso": "JP",
  "roundingModels": [
    {
      "currencyIso": "JPY",
      "currencyExponent": 0,
      "direction": "Nearest",
      "model": "multiple1000.none"
    }
  ]
}

deliveryCountryIsorequiredstring
ISO code of the shopper’s delivery country.
currencyIsorequiredstring
Currency to which the rounding rule applies. e.g., GBP, JPY
currencyExponentrequiredinteger
Number of decimal places used e.g., 2 for GBP
directionrequiredenum
Rounding direction Up, Down, Nearest
modelrequiredstring
Indicates the rounding model that will be applied to product price within ESW Rounding Methods e.g., Fixed, Multiple, and None. For the multiple1000.none or none.fixed99 rounding models, the rounding methods are Fixed, Multiple and None

Multiple Currency Rounding Rules per Country

{
  "deliveryCountryIso": "FR",
  "roundingModels": [
    {
      "currencyIso": "EUR",
      "currencyExponent": 2,
      "direction": "Up",
      "model": "none.none"
    },
    {
      "currencyIso": "GBP",
      "currencyExponent": 2,
      "direction": "Down",
      "model": "none.fixed99"
    }
  ]
}

Model Rules

The following model rules govern how price values are adjusted based on the relationship between the currency exponent and the number of digits defined in the rounding model:

Truncate

If the number of digits in the rounding model exceeds the number of digits allowed by the currency exponent, the extra digits are truncated.

Extend

If the currency exponent allows more digits than the rounding model specifies, the model is extended with trailing zeros.


Parameters and Values

ParameterValue
Shipping countryFrance
Base currencyEUR
Price book currencyEUR
Shopper currencyGBP
Product price in the price bookEUR 100
Uplift3%
Duty7%
Tax20%
FX Rate (EUR – GBP)0.8313

Based on these values, the calculated price will be 109.9410876 GBP.

Calculated as: Price of product in price book x Uplift x Duty x Tax x FX rate
= 100 x 1.03 x 1.07 x 1.2 x 0.8313
= 109.9410876.

ESW rounding rules applied to the calculated price.

Rounding rules and examples

Rounding Method: none

{"currencyIso":"GBP","currencyExponent":2,"direction":"Up","model":"none.none"}

Based on this, 109.9410876 GBP is displayed as 109.94 GBP on the storefront.

Rounding Method: fixed

{"currencyIso":"GBP", "currencyExponent":2, "direction":"Up", "model":"none.fixed25"}

Based on this, 109.9410876 GBP is displayed as 110.25 GBP on the storefront, and the shipping cost 27.49 is displayed as 28.25 GBP in the cart.

Rounding Method: multiple

{"currencyIso":"JPY","currencyExponent":0,"direction":"Nearest","model":"multiple1000.none"}

When the multiple1000 rounding logic is applied, 14713/1000 = 14.7 > Nearest > 15 > 15 x 1000
= 15000

The difference in product prices before and after the rounding model is applied is recorded at the order product line item level as the ESW Delta Rounding Value.

ESW Rounding Rules Matrix

Currency ExponentDirectionExponent Rounding (Fixed)Exponent Rounding (Multiple)Exponent Rounding (None)Whole Number Rounding (Fixed)Whole Number Rounding (Multiple)Whole Number Rounding (None)
0UpN/AN/AN/ASupportedSupportedSupported
0DownN/AN/AN/ASupportedSupportedSupported
0NearestN/AN/AN/ASupportedSupportedSupported
2UpSupportedSupportedSupportedSupportedSupportedSupported
2DownSupportedSupportedSupportedSupportedSupportedSupported
2NearestSupportedSupportedSupportedSupportedSupportedSupported