2.15.

## How can I perform in-form calculations?

You can use Polydojo forms to perform a large variety of on-the-fly calculations.

For starters, let's simply add two numbers.

2. Against 'Variable', type `X` (in caps) and click 'Done'.
3. Similarly add another 'Number' field labeled "Enter Y" and set 'Variable' to `Y` (in caps).
4. Add a 'Calculation' field labeled "The sum of X and Y is".
5. Set 'Expression' to `X + Y` (in caps); and finally click 'Done'.

That is it! Your form will now automatically add two numbers! Let's check it out.

### Try It Out!

1. Click Save > Back to forms > Select the form you just saved > Fill.
2. The form will open in a new tab. Start typing some numbers!
3. You'll see that as you type, "The sum of X and Y is" is auto-calculated.

Now instead of `X + Y`, you could've set Expression to:

1. `X - Y` (Subtraction)
2. `X / Y` (Division)
3. `X * Y` (Multiplication)
4. `X*X + Y*Y` (Sum Of Squares)

You could add another 'Number' field labeled 'Enter Z', with variable `Z` (in caps). Then, you could use compound expressions such as:

1. `X * (Y + Z)` (Add, then multiply)
2. `(X + Y + Z) / 3` (Average)
3. `X * (1 - 10/100)` or  `X * 0.90` (10% Off)
4. `Y * (1 + 18/100)` or  `X * 1.18` (18% extra, for tax etc.)