Template:Change2/doc

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

Use[edit]

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[edit]

The following syntax:

{{Change2|4301262|5029196}}

produces the following Wiki markup:

|align=right|Template:Round||align=right|Template:Round||align=right|+Template:Round%

which can be used in a table:

base target % change
Template:Round Template:Round +Template:Round%

See also[edit]