Difference between revisions of "Template:Add"
Jump to navigation
Jump to search
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...") |
Kevin Wang (talk | contribs) m |
||
Line 1: | Line 1: | ||
{{#vardefine:{{{1}}}|{{#expr:{{#var:{{{1}}}}}+{{{2|0}}}}}}}<noinclude>Shorthand for adding variable to something: "<nowiki>{{#vardefine:{{{1}}}|{{#expr:{{#var:{{{1}}}}}+{{{2|0}}}}}}}</nowiki>" | {{#vardefine:{{{1}}}|{{#expr:{{#var:{{{1}}}}}+{{{2|0}}}}}}}<noinclude>Shorthand for adding variable to something: "<nowiki>{{#vardefine:{{{1}}}|{{#expr:{{#var:{{{1}}}}}+{{{2|0}}}}}}}</nowiki>" | ||
− | + | Examples: | |
{{Save|x}} | {{Save|x}} | ||
{| class=wikitable | {| class=wikitable |
Latest revision as of 13:07, 26 August 2022
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 |