Template:Change2/doc

Template page

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