Template:Add

From QBWiki
Jump to navigation Jump to search

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