# 6.e.1. Simple Computations

[comment memo="Performing Calculations" memo_size="large" memo_style="bold"] [link url="//www.soapnote.org/sample/performing-calculations/" memo="(«) Previous"] Note for example below: To switch views between the Active Form and Markup Code, click on "View" in the upper right of this page. Then choose "Form" to see the Active Form or choose "Markup" to reveal the Markup Code. In the example below, basic computations such as addition, subtraction, multiplication, and division is performed on numbers gathered with Text ([text]) input fields. Example: This calculator performs simple computations [text name="A"] <-- A (enter a number) [text name="B"] <-- B (enter a number) A + B --> [calc value="score1=(A)+(B)" memo="addition"] A - B --> [calc value="score2=(A)-(B)" memo="subtraction"] A x B --> [calc value="score3=(A)*(B)" memo="multiplication"] A / B --> [calc value="score4=(A)/(B)" memo="division"] A raised to the power of B --> [calc value="score5=Math.pow((A),(B))" memo="exponent"] You can see that the Calc Tag has a certain format to it. "value" contains the entire computation in double quotes. "score1" is a required name for the computation. In the sample, you see that value is set equal to "score1", "score2", "score3", "score4", and "score5". A new name is needed for each computation, but it can be more descriptive than "score1". "A" refers to the name of the first Text Box Tag. "B" refers to the name of the second Text Box Tag. In between "A" and "B" is the operator (+, -, *, and /). The result shows up in the result box after "Calculate Result" is pressed. Here are [link url="//soapnote.org/sample/calculation/" memo="more sample calculators"]. [link url="//www.soapnote.org/sample/interpreted-results/" memo="(») Next"] [link url="//www.soapnote.org/sample/walkthrough-tutorial/" memo="(^) Walkthrough Contents"]

### Result - Copy and paste this output:

Sandbox Metrics: Structured Data Index 0, 13 form elements, 216 boilerplate words, 3 text boxes, 4 links, 1 comments, 5 calculations, 3 total clicks

## Send Feedback for this SOAPnote

You must be logged in to post a comment.