> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://support.robaws.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Amount Formulas

With **Amount Formulas** you can substantiate the quantity of a line by splitting it into several parts. Each part is calculated with a formula (e.g. the volume of a tree), and the sum of all parts becomes the quantity of the line. You can show this calculation on the document, so that your customer sees how you arrived at a given quantity — or keep it hidden for internal use.

Besides quotations, this also works on orders, invoices, supply orders and the progress claim. Handy, for example, for an earthworks contractor who wants to record per row from which house number to which house number something was carried out: the **name** of a row carries just as much information as the numbers.

**For example:** we draw up a quotation to remove and shred a few trees, with a price per cubic metre. On site we measured the number of trees, with an estimate of the average radius and height. By entering this in detail, we get a correct volume — and we can pass that substantiation on to the customer on the quotation document.

![Below the quotation line, a block appears that substantiates the quoted volume.](https://storage.crisp.chat/users/helpdesk/website/-/e/a/d/f/eadf6dec760ec000/aantal-formules-nl_7bq0m6.png)

## Use

To use an amount calculation on a line:

1. Hover with your mouse over the **Quantity** of a line and click the coloured **info icon**.

![Figure 1: the info icon appears when hovering over the Quantity, when the option is activated and the module supports it.](https://storage.crisp.chat/users/helpdesk/website/-/e/a/d/f/eadf6dec760ec000/aantal-formules-figure1-info-i_1ugjijh.png)

2. **Choose the formula** in the combobox at the top right (e.g. "Volume m3").
3. Click **Add line**.
4. Give the new line a clear **name** and **fill in the parameters**. The columns correspond to the variables from the formula.
5. **Check** the result; the total at the bottom becomes the quantity of the quotation line.
6. **Save** by clicking away or by clicking the cross.

![The 'Amount calculation' with the formula choice, the parameter columns and the calculated result per row.](https://storage.crisp.chat/users/helpdesk/website/-/e/a/d/f/eadf6dec760ec000/aantal-formules-calc-popup-nl_lolzwq.png)

This window contains two options:

- **Show on PDF:** activate this to show the amount calculation on the document. Leave it off to keep the substantiation internal only.
- **Show separate formula:** the formula used is sometimes hard to read or not intended for the customer. Activate this option to show a readable formula (e.g. "Pi x r² x h") on the PDF instead.

As long as there is an amount formula on a line, you can no longer adjust the quantity of that line manually — delete the formula first if you do want to.

## Settings

To be able to use Amount Formulas:

1. Go to **General settings** > **Master data** and switch **Amount Formulas** on.
2. Open **Amount Formulas** and add a **new formula** with a name and a formula.
3. In the **Formula** field you enter the calculation, e.g. `lengte * breedte`. Every word you use automatically becomes a parameter to fill in (in order of appearance).
4. **Save** the settings.
5. **Use** the formula in a supported module such as a quotation, order, invoice, supply order or progress claim.

> Tip: if you rename the variable names in a formula later, the values already entered are kept — they are stored by position. Do be careful when adding, deleting or rearranging variables.

**Formula possibilities**

| Formula | Explanation | Example | Result |
| --- | --- | --- | --- |
| **+** | Adds two numbers | 5 + 6 | 11 |
| **-** | Subtracts two numbers | 8 - 3 | 5 |
| **\*** | Multiplies two numbers | 9 \* 3 | 27 |
| / | Divides two numbers | 9 / 3 | 3 |
| % | Modulo: gives the remainder after division | 8 % 3 | 2 |
| **^** | Exponent | 5 ^ 2 | 25 |
| round( x ) | Rounding | round(1.6) | 2 |
| ceil( x ) | Rounding up | ceil(2.4) | 3 |
| floor( x ) | Rounding down | floor(2.7) | 2 |
| min(x,y,z) | Gives the lowest number | min(5,9) | 5 |
| max(x,y,z) | Gives the highest number | max(17,5,9) | 17 |
| sqrt( x ) | Square root of x | sqrt(64) | 8 |

The formulas use the math.js library; see [this list](https://mathjs.org/docs/reference/functions.html) for all possibilities.