Template:Add
Revision as of 13:07, 26 August 2022 by Kevin Wang (talk | contribs)
Shorthand for adding variable to something: "{{#vardefine:{{{1}}}|{{#expr:{{#var:{{{1}}}}}+{{{2|0}}}}}}}"
Examples:
Input | Output |
---|---|
{{#vardefine:x|100}}x = 100 {{Add|x|20}}x + 20 = {{#var:x}} {{#vardefine:y|200}}y = 200 {{Add|x|{{#var:y}}}}x + y = {{#var:x}} |
x = 100
x + 20 = 120 y = 200 x + y = 320 |