Create a Calculation Question
You can add a calculation question to allow the device user to tap a button to trigger a calculation in the form. The result can then be evaluated in a form report. Calculations can use numbers, the values entered in answer to other questions in the form, and custom variables. They support most mathematical operators as well as if-then-else expressions.