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

Template:Changes

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

This template takes up to 20 numbers and calculates the percent change between each pair and formats them for inclusion in a table in either ascending or descending order.

Use

This template has the following syntax:

{{Changes|number01|...|number20|order=|nd=|pd=|ic=|dc=}}

where:

  • number01|...|number20 are up to 20 numbers. If a number is not known, use NA or &#​32;
  • order= is an optional change calculation order:
    • order=a calculate percent change in ascending order. (default)
    • order=d calculate percent change in descending order.
  • nd= is an optional number of decimal places in the formatted numbers. (default=0)
  • pd= is an optional number of decimal places in the formatted percent changes. (default=2)
  • ic= is an optional color for a percent increase. (default=green)
  • dc= is an optional color for a percent decrease. (default=red)

Example

The following Wiki markup:

{|class="wikitable sortable"
![[U.S. state|State]]
![[1980 United States Census|1980 Census]]
!% Pop Change
![[1990 United States Census|1990 Census]]
!% Pop Change
![[2000 United States Census|2000 Census]]
!% Pop Change
![[2010 United States Census|2010 Census]]
!% Pop Change
![[2020 United States Census|2020 Census]]
|-
|[[Wyoming]]
{{changes|469557|453588|493782|563626|576851}}
|}

creates the following table:

State 1980 Census % Pop Change 1990 Census % Pop Change 2000 Census % Pop Change 2010 Census % Pop Change 2020 Census
Wyoming 469,557 −3.40% 453,588 +8.86% 493,782 +14.14% 563,626 +2.35% 576,851

You can put this table in descending order with {{changes|order=d|576851|563626|493782|453588|469557}}:

State 2020 Census % Pop Change 2010 Census % Pop Change 2000 Census % Pop Change 1990 Census % Pop Change 1980 Census
Wyoming 576,851 +2.35% 563,626 +14.14% 493,782 +8.86% 453,588 −3.40% 469,557

See also

  • This template invokes Template:Changes/a and Template:Changes/d.
  • See also Template:Change.
The above documentation is transcluded from Template:Changes/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:Changes&oldid=7768"
Categories:
  • Mathematical formatting templates
  • Sorting templates
Last edited on 26 November 2020, at 19:12

MOASSpedia

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