Template:Add
Revision as of 12:05, 28 July 2022 by Kevin Wang (talk | contribs) (Created page with "{{#vardefine:{{{1}}}|{{#expr:{{#var:{{{1}}}}}+{{{2|0}}}}}}}<noinclude>Shorthand for adding variable to something: "<nowiki>{{#vardefine:{{{1}}}|{{#expr:{{#var:{{{1}}}}}+{{{2|0...")
Shorthand for adding variable to something: "{{#vardefine:{{{1}}}|{{#expr:{{#var:{{{1}}}}}+{{{2|0}}}}}}}"
Example:
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 |