Simple Computations

Samples, Snippets, & Training
No Comments
Loading Add to Favorites
0 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 5 (0 votes, average: 0.00)
log on to rate
Loading...
Share
Tweet
Cite
[comment memo="Simple Computations" memo_size="large" memo_style="bold"]
[link url="//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="//soapnote.org/sample/interpreted-results/" memo="Next"]
[link url="//soapnote.org/sample/walkthrough-tutorial/" memo="Walkthrough Contents"]
Simple Computations
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 () input fields.

Example:
This calculator performs simple computations
<-- A (enter a number)
<-- B (enter a number)

A + B --> additionscore1=(A)+(B)
A - B --> subtractionscore2=(A)-(B)
A x B --> multiplicationscore3=(A)*(B)
A / B --> divisionscore4=(A)/(B)
A raised to the power of B --> exponentscore5=Math.pow((A),(B))

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 more sample calculators.
Next
Walkthrough Contents
Result - Copy and paste this output:

Leave a Reply