• Home
  • Random
  • Recent changes
  • Special pages
  • Settings
  • About MOASSpedia
  • Disclaimers
MOASSpedia
  • 216.73.216.154
  • Talk
  • Watchlist
  • Contributions
  • Log in

Template:Change2

Template Discussion
  • Language
  • Watch
  • History
  • Edit
    • Page information
    • Permanent link
    • What links here
Template documentation[view] [edit] [history] [purge]

This template takes compares two numbers, calculates the percent change, and formats the three numbers for inclusion in three columns of a table.

Use

This template has the following syntax:

{{Change2|number1|number2|numbers-dec|percent-dec|increase-color|decrease-color}}

where:

  • number1 is the base number. If the base number is not known, use NA or &#​32;.
  • number2 is the target number. If the target number is not known, use NA or &#​32;.
  • numbers-dec is an optional number of decimal places in the formatted numbers. (default=0)
  • percent-dec is an optional number of decimal places in the formatted percent change. (default=2)
  • increase-color is an optional color for a percent increase. (default=green)
  • decrease-color is an optional color for a percent decrease. (default=red)

Example

The following syntax:

{{Change2|4301262|5029196}}

produces the following Wiki markup:

|align=right|4,301,262||align=right|5,029,196||align=right|+16.92%

which can be used in a table:

base target % change
4,301,262 5,029,196 +16.92%

See also

  • This template is a simplified version of Template:Change.
  • This template invokes Template:Changes/d.
The above documentation is transcluded from Template:Change2/doc. (edit | history)
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://moasspedia.org/w/index.php?title=Template:Change2&oldid=7765"
Categories:
  • Mathematical formatting templates
  • Sorting templates
Last edited on 27 November 2020, at 14:54

MOASSpedia

Content is available under Creative Commons Attribution-ShareAlike unless otherwise noted.
  • This page was last edited on 27 November 2020, at 14:54.
  • Content is available under Creative Commons Attribution-ShareAlike unless otherwise noted.
  • Privacy policy
  • About MOASSpedia
  • Disclaimers
  • Desktop