## Arithmetic Calculations

You can operate with data from any data source on your prototype like input widgets, text widgets, Data Grids, Data Lists, Data Masters etc. The most basic and common operations are the arithmetic ones which apply only to numbers. You will be able to operate with either integer or decimal numbers. Notice that the only number formats understood by Justinmind Prototyper are the following:

- Integers matching the regular expression: [-+]?(?:(?:(?>\\d{1,3})[@](?=\\d\\d\\d))+(?:\\d\\d\\d)|\\d*).

  Examples:

  - 25 (taken as 25)

  - 25,134 (taken as 25134)

  - 25.134.341 (taken as 25134341)

  - 25,134,341 (taken as 25134341)

- Decimals matching the regular expression: [-+]?(?:(?:(?>\\d{1,3})[@](?=\\d\\d\\d))+(?:\\d\\d\\d)(?:[#]\\d*)?|\\d*(?:[#]\\d*)?).

  Examples:

  - 25,34 (taken as 25.34)

  - 25.34 (taken as 25.34)

  - 25.341 (taken as 25.341)

  - 25.134,34 (taken as 25134.34)

  - 25,134.34 (taken as 25134.34)

To create an arithmetic operation and store or display its result follow the steps:

1. Select a widget on the screen and follow the steps to create a Set Value action (see Actions).

2. In the Interactions dialog click on the 'Calculated' button. The Expression Builder will appear.

3. Create the desired arithmetic expression using numeric functions and the required data.

4. Press Ok to close the Expression Builder dialog.

5. Select a widget on the small canvas as the target to display the result of the expression or select a variable to store it.

6. Press Ok to apply the changes.

You can also use arithmetic operations within a event's condition in order to compare the result with any other data source.