Rule: Round Numbers#

ℹ️ This rule is also part of the “Calculation” rule.

This rule allows you to round numeric values (such as prices) in a specific element to a chosen number of places – for example, to units, tenths, or hundredths.

Extra features#

  • Rounding to various levels: units, tenths, hundredths, hundreds
  • Choice of rounding type: up, down, standard, to zero
  • Choice of decimal separator (period or comma)
  • Choice of thousands separator (space, period, comma, none)

Practical examples#

Example: Round amounts to units, tenths, or hundredths#

1. Creating a new rule:

  • Open the “Rules” page.
  • Click the New rule button.

2. Selecting the rule type:

  • In the Rule type field, select the Round Numbers option.

3. Selecting products:

  • In the Query field, choose either All products or create your own Product query for specific products you want the rule to apply to.

4. Choosing the element to change:

  • In the Element field, select the element you want to modify.

5. Setting the rounding type:

  • In the Rounding type field, select the desired method, for example: up, down, standard, 0, or 0.5.

6. Selecting the rounding level:

  • In the Round to field, choose units, tenths, hundredths, etc., depending on the type of rounding you need.

Setting the decimal separator:

  • Choose whether you want to use a comma or period as the decimal separator.

Setting the thousands separator:

  • In the Thousands separator field, select the desired separator (space, period, comma, or no separator).

Naming the rule:

  • In the last step, enter the rule name, for example: “Round price to units”.

FAQ#

What is the Round Numbers rule for?#

This rule allows you to round numeric values (e.g., prices, discounts, or margins) in any element to the desired number of places – for example, to units, tenths, or hundredths. It can also be used to adjust number formatting (decimal period/comma, thousands separators, etc.).

What values can I round to?#

In the “Round to” field, you can choose:

  • units (e.g., 123.45 → 123),
  • tenths (e.g., 123.45 → 123.5),
  • hundredths (e.g., 123.456 → 123.46),
  • hundreds (e.g., 1234 → 1200).

What rounding types can I use?#

In the “Rounding type” field, the following options are available:

  • up – always rounds up,
  • down – always rounds down,
  • standard – regular rounding based on the value after the decimal point,
  • to 0 or 0.5 – rounds to the nearest half unit or 0,
  • to 0.9 - rounds to the nearest value ending in .9
  • to 0.99 - rounds to the nearest value ending in .99

Can this rule be applied to elements other than prices?#

Yes. The rule can be used on any numeric element, e.g., weight, margin, percentage values, or quantity. It is important that the element contains valid numeric values.

What happens if the element does not contain a numeric value (e.g., text or an empty value)?#

Mergado will skip that record and make no changes. The rule is applied only to values that can be unambiguously converted to a number.

Can I choose whether to use a comma or period as the decimal separator?#

Yes. In the “Decimal separator” field, choose whether to use a comma (,) or period (.). 💡 For example, for international projects, a period is usually more appropriate, while for Czech feeds, a comma may be preferred.

How do I set the thousands separator?#

In the “Thousands separator” field, select one of the options:

  • space (e.g., 1 000),
  • period (e.g., 1.000),
  • comma (e.g., 1,000),
  • no separator (e.g., 1000).

Can the rule be applied only to selected products?#

Yes. In the “Query” field, choose either “All products” or create a custom Product query, for example by type, brand, or price. This allows you to round only a specific group of products.

Can this rule completely remove the decimal part of a price?#

Yes. Choose the rounding type “standard” and then set the rounding to units. Mergado will automatically remove everything after the decimal point, e.g.: 123.99 → 123.

Can I use this rule to convert prices, e.g., from 123.4567 to 123.46?#

Yes. Choose the rounding type “standard” and in the “Round to” field select hundredths. Mergado will automatically adjust the result to two decimal places.

Can this rule also format currency (e.g., add EUR)?#

No. The Round Numbers rule works only with numeric values. If you want to add currency, use the Rewrite or Find and replace rule afterward.

Can I use this rule as part of another calculation?#

Yes. The Round Numbers rule is also part of the Calculation rule. This means you can first perform a calculation (e.g., price without VAT) and then round the result within the same rule.

How do I check if the rounding was applied correctly?#

After saving and applying the rules or after regenerating the feed, open the product preview or use the “Rule walkthrough” feature. There you can verify whether the value actually changed according to the chosen rounding type and level.

🇨🇿 🇬🇧 🇩🇪 🇭🇺