Welcome to the Virtual Education Wiki ~ Open Education Wiki
Form:Test calculation form: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
<form> | <noinclude> | ||
This is the 'Calculation' form. The form is used to perform simple calculations. | |||
</noinclude> | |||
<includeonly> | |||
{{{info|calculation form}}} | |||
{{{for template|Calculation}}} | |||
Enter two numbers and select an operator below. | |||
{| class="formtable" | |||
! Number 1: | |||
| {{{field|number1}}} | |||
|- | |||
! Number 2: | |||
| {{{field|number2}}} | |||
|- | |||
! Operator: | |||
| {{{field|operator|input type=select|values=+,-,*,/}}} | |||
|} | |||
{{{end template}}} | |||
(You can see the form this query uses at [[Form:Calculation]], and the template it uses at [[Template:Calculation]].) | |||
{{#ifexpr: {{{number1|0}}} AND {{{number2|0}}} | |||
| Result: {{#switch: {{{operator}}} | |||
|+ = {{#expr: {{{number1}}} + {{{number2}}}}} | |||
|- = {{#expr: {{{number1}}} - {{{number2}}}}} | |||
</ | |* = {{#expr: {{{number1}}} * {{{number2}}}}} | ||
|/ = {{#expr: {{{number1}}} / {{{number2}}}}} | |||
}} | |||
}} | |||
</includeonly> |
Revision as of 13:46, 21 April 2023
This is the 'Calculation' form. The form is used to perform simple calculations.