### 1. What are the functions in the studio used for?

The functions in the studio allow you to perform calculations quickly, directly within your Ermeo application.

Creating a formula in a numerical brick

Tags are also very useful for defining formulas in a digital brick.

Go to the editing studio for your form:

- In the Measurements section (section 2), duplicate brick 2.1 ‘Engine power’ by pressing the ... button to the right of the brick.
- Rename brick 2.1 to ‘Motor power is ...’ and brick 2.2 to ‘Motor power 2’ to distinguish the 2 motors. To name the bricks, enter ‘Title’ in the brick parameters.
- Drag and drop a new Number brick after the two engine power bricks.
- Call this brick ‘Average engine power’.
- In this brick, in the parameters section, change the value of Number to Formula (fx).
- All formulas must begin with calc(
- Add a new parenthesis just after the first one
- Copy the tag from brick 2.1 and paste it after the parenthesis.
- Add the mathematical symbol +.
- Copy the tag from brick 2.2 and paste it after the +, then close the parenthesis.
- Add the division symbol ‘/’ and the value ‘2’ (/ 2), then close the parenthesis.

The brick will then display the average of the powers entered in bricks 2.1 and 2.2.

Creating a formula in a brick makes it possible to calculate data and save your field operators time, while ensuring the accuracy of the information provided.

On this last brick, in the default value for performing a calculation, you need to select fx. Next, start the formula with **calc(** , followed by the first tag in your brick, in this case the **##tag1##** tag. As we want to multiply, we'll use this ‘***’** character (as in Excel), followed by the second tag in the **##tag2##** brick.

This gives the formula **calc(##tag1##*##tag2##)**

👇 This is how it will look in the application:

It is not possible to insert all types of formulas within a number brick. Only basic operators (addition, subtraction, multiplication, division) are possible.

**Warning:** If you enter decimal values by default, please use the ‘.’ character and not the ‘,’ character.

For example: 4.5 and not 4.5

Function | Description | Specificity | Widget type |

abs(x) | Calculates the absolute value of the number x passed as an argument | Number | |

cube(x) | Calculates the cubed multiplication of the number x passed as an argument | Number | |

gcd(x,y) | gcd(x,y): Calculates the greatest common divisor between the numbers x and y passed as arguments | Number | |

mod(x,y) | mod(x,y): Calculates the remainder of the modulo division of the numbers x divided by y | Number | |

pow(x,y) | pow(x,y): Calculates the power of the number x by y (x^y) | Number | |

sign(x) | sign(x): Returns -1 if the number x passed as argument is negative, or 1 if the number x passed as argument is positive (or zero) | Number | |

square(x) | square(x): Returns the result of multiplying the value x passed as an argument by itself (x*x) | Number | |

round(x) | Calculates the rounded value of the number x passed as an argument.The returned value is the nearest whole number (rounded down or up).It is not possible to choose between rounding up or rounding down. | Specific withdecimal | Number |

compare(x,y) | Returns 1 if the number x passed as argument is greater than the number y passed as argument. Returns -1 if y is greater than x.Returns 0 if x is equal to y. | Number | |

equal(x,y) | Returns 1 if the numbers x and y passed as arguments are equal.Returns 0 if x and y are different. | Number | |

unequal(x,y) | Returns 1 if the numbers x and y passed as arguments are different.Returns 0 if x and y are equal. | Number | |

larger(x,y) | Returns 0 if the number y passed as argument is greater than or equal to the number x passed as argument. Returns -1 if y is less than x. | Number | |

smaller(x,y) | Returns 1 if x is less than or equal to y. Returns 0 if x is greater than y | Number | |

max(a,b,c) | Returns the largest value among the values a,b and c | Number | |

min(a,b,c) | Returns the smallest value among the values a,b and c | Number | |

variance(a,b,c) | Returns the variance of the values a,b and c passed as an argument | Number | |

hasNumericValue(x) | Returns 1 if the x value passed as argument is a number. | Number | |

isInteger(x) | Returns 1 if the value x passed as an argument is an integer | Number | |

isNegative(x) | Returns 1 if the value x passed as argument is a negative number.Returns 0 if the number is strictly greater than 0 | Number | |

isPositive(x) | Returns 1 if the value x passed as argument is a positive number.Returns 0 if the number is strictly less than 0. | Number | |

isZero(x) | Returns 1 if the value x passed as argument is equal to 0.Returns 1 if the number is different from 0 | Number | |

Count | Identify the total number of Iterations | Number | |

Random | Number | ||

Iteration | Number, text | ||

Sum | Number | ||

Mean | Number | ||

##report_id## | Having a unique report alphanumeric number creates the uniqueness of a report. | It can only be used in the custom templates and not the design studio | Custom template |

**Note**To use these functions, place the function name in the calc formula.