# Boxes - Correct Price Math (legacy document)

## 1. Add VAT

Use this box to add the VAT to a given price.

**Example**: Price without VAT = 17.25€

**After using the box with 19 % as default value**: 20.53€

## 2. Column Math

Use this box to calculate with two additional input values. Enter static values or choose the input of other columns. Keep in mind that firstly the amount of *Input 1* and *Input 2* is calculated according to the chosen operator.

**How to use the box:** 1. Add that box to the column that includes one part of the calculation.

Choose one of the operators (+,-,*,/). from the dropdown list.

Choose an input column from the dropdown list (Be aware at what stage this calculation should be done)

**OR**enter a static value for*Input 1*.Choose an input column from the dropdown list (Be aware at what stage this calculation should be done)

**OR**enter a static value for*Input 2*.Enter a value for the rounding accuracy. The default value is 0.

### 2.2 Choose rounding type

The standard rounding rounds up, if the last digit is 5 or above, and down, if it is 4 or below.Some logics, do, however, need the numbers to be constantly rounded down or rounded up.You can achieve this by choosing either *round up* or *round down*from the dropdown.

**Please note**: You should only change the rounding logic, if needed for your logic.

## 3. Convert Currency

This box is used to convert the currency of the prices within your feed.

**How to use the box:** 1. Add the box to the connection containing the price you want to convert.

Choose the current currency of the price.

Choose the currency that you want the prices to be converted to.

This box uses the conversion rate that is valid at the point of processing (UTC). The source for this information is the "Open Exchangerates" API.

## 4. Discount

This box is used to give a discount on the prices for the criteria you select.

Fill in the

*Mandatory Column*including the main criteria.List all the searchterms in the free space that can appear in this column and you want to give a discount on. List them without any delimiter; just enter them per line.

Choose from the dropdown list if the the discount should be given on the products that contain the searchterms or on all that don't include it, or if it should be given if the column is empty. You can also enter a mathematical value and choose from the dropdown list that a discount should be given if the values in the mandatory column are greater, less or equal to that.

You can enter a second column and its searchterm values if you want to. It works as described before.

Enter the value of the discount that shall be given.

Choose from the dropdown list what should happen if the value in the column you want to change isn't a number: Should the value be left unchanged, treated as a 0 or if an empty string should be returned.

In this example a discount of 11% is given to all Boots and Sneaker for women.

## 5. Disount Percentage

This box is used to calculate the discount percentage between to given prices.

Choose the column from the dropdown list where to find the old price.

Choose the column from the dropdown list where to find the new price.

Enter a value for the rounding accuracy. The default value is 0.

Add a text before or after that value in the given free spaces.

## 6. In-Row Math

The *In-Row Math* box can be used to add or mulitply the values in one cell.

**How to use the box:** 1. Type the delimiter that is used in your cells.

Choose the operator that you want to apply.

The delimiters will now be replaced by the chosen operator and the according arithmetic result will be shown.

**Example:**

Values in one cell: 2,3,6

**After using the box:** 11

## 7. Make Valid Price

For Google and most of the other export channels the valid decimal separator is period ("."), not comma (","). Some feeds also contain currency in price column. With this box the decimal seperator can be changed and the currency is removed.

If there is an **invalid value** in your data that can't be transformed you can choose to assign a static value to that cell (0.00 or 0,00) or to leave that cell empty. If it will be 0.00 or 0,00 depends on the settings you did above.

**Example**: comma decimal separator and currency symbol in feed

**After using the box:**

## 8. Math

The Math box is used to calculate with basic arithmetic operators. The column were this box is added is the first part of the calculation. Then choose the operator and the column were the second part of the calculation is in from the dropdown list or enter a static value. This could come in handy to add shipping to the price in order to get the total.

### 8.1 Calculate with a value from another column

Choose an operator (+,-,* /) in the first dropdown.

Choose a column from that dropdown list to calculate with. Leave the free space next to

*Static Value*unchanged.Enter a value for the rounding accuracy.

Choose from the dropdown list what should happen if the value in the column you want to change isn't a number: Should the value be left unchanged, treated as a 0 or if an empty string should be returned.

**Example**: price= 7.99

(+ shipping 2.99)

**After using this box:** (new total) price = 10.98

### 8.2 Calculate with a fixed value

The other way to use it is to add, subtract, multiply or divide with a static value. A useful case could be to calculate a 20% discount (e.g. multiply with 0.8).

Choose an operator (+,-,* /) in the first dropdown.

Enter a static value. Leave the free space next to

*Column*unchanged.Enter a value for the rounding accuracy.

Choose from the dropdown list what should happen if the value in the column you want to change isn't a number: Should the value be left unchanged, treated as a 0 or if an empty string should be returned.

**Example**:

9.99

**After using the box:**:

7.99

**Please note**: The result would be 7.992 but it is rounded to two decimals. The *Rounded Precision* is an optional field to specify the decimals.

### 8.3 Choose rounding type

The standard rounding rounds up, if the last digit is 5 or above, and down, if it is 4 or below.Some logics, do, however, need the numbers to be constantly rounded down or rounded up.You can achieve this by choosing either *round up* or *round down*from the dropdown.

**Please note**: You should only change the rounding logic, if needed for your logic.

## 9. Math Template

This box is used to calculate the amount of up to 4 columns.

**How to use the box:** 1. Add that box to the column that includes one part of the calculation.

Choose 1 to 3 columns from the dropdown lists.

Enter a calculation template using "value" for the current field, "column1" for the first chosen column, "column2" for the second chosen column and "column3" for the third chosen column. Enter brackets and operators as used for calculations. You don't need to add Whitespaces inbetween. Just start your input with {{ and end your input with }}.

Enter a value for the rounding accuracy.

### 9.2 Choose rounding type

The standard rounding rounds up, if the last digit is 5 or above, and down, if it is 4 or below.Some logics, do, however, need the numbers to be constantly rounded down or rounded up.You can achieve this by choosing either *round up* or *round down*from the dropdown.

**Please note**: You should only change the rounding logic, if needed for your logic.

## 10. Round Numeric Values

Use this box to round numeric values according to the given value. Choose from the dropdown list what should happen if the value in the column you want to change isn't a number: Should the value be left unchanged, treated as a 0 or if an empty string should be returned.

**Example**:

9.95863935

**After using the box:**

9.96

## 11. Add thousand delimiter

To add thousand delimiters to your prices you can use our "Preg Replace Box".

Make sure you have valid prices with a dot as the decimal delimiter before you execute the following steps. Enter the the expression

/(\d{1,3})(\d{3})?(\.\d{2})/

into the search field. This expression separates your price into several groups.

To rearrange this group (adding thousand delimiters) enter

$1,$2$3

into the replace field. This will enter the groups and add commas in between.

This will work for prices up to 999,999.99.

**Price before using the box**:

13337.99

**After using the box:**

13,337.99

For prices under 1.000, you will see that the comma will be set nevertheless. To cover theses cases, you can use a Text Replace box and simply replace ",." with ".".