• Home
  • Random
  • Log in
  • Settings
  • About English Wikipedia @ Freddythechick
English Wikipedia @ Freddythechick

Template:Sum/sandbox

  • Language
  • Watch
  • View source
< Template:Sum
__EXPECTUNUSEDTEMPLATE__This is the template sandbox page for Template:Sum (diff).
Template documentation[view] [edit] [history] [purge]

Usage

This template uses Lua:
  • Module:Math (sandbox)

This template performs addition. For example, if you want to add 2 and 3, use this: <syntaxhighlight lang="wikitext" inline>5</syntaxhighlight>, which creates 5. It handles positive and negative integers, fractions, and decimals to thirteen decimal points:

  • <syntaxhighlight lang="wikitext" inline>-2</syntaxhighlight> produces: -2
  • <syntaxhighlight lang="wikitext" inline>1.5</syntaxhighlight> produces: 1.5
  • <syntaxhighlight lang="wikitext" inline>1.6666666666667</syntaxhighlight> produces: 1.6666666666667

It also handles some symbols such as "pi" (π) or "e":

  • <syntaxhighlight lang="wikitext" inline>3.1415926535898</syntaxhighlight> produces 3.1415926535898
  • <syntaxhighlight lang="wikitext" inline>2.718281828459</syntaxhighlight> produces 2.718281828459

More than two parameters may be employed:

  • <syntaxhighlight lang="wikitext" inline>3</syntaxhighlight> produces 3

It does not accept commas or spaces for thousands separator.

See also

  • {{Multiply}}
The above documentation is transcluded from Template:Sum/doc. (edit | history)
Editors can experiment in this template's sandbox (edit | diff) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://enwiki.freddythechick.net/index.php?title=Template:Sum/sandbox&oldid=9333839"
Last edited on 22 January 2022, at 15:07

Languages

      This page is not available in other languages.

      English Wikipedia @ Freddythechick
      • This page was last edited on 22 January 2022, at 15:07.
      • Content is available under Creative Commons Attribution-ShareAlike 4.0 unless otherwise noted.
      • About English Wikipedia @ Freddythechick
      • Desktop