Template:Change/doc

Use
This template calculates the percent change between two real number values and displays the result in a sortable format.

The syntax for this template is as follows.

Examples
The following sortable tables illustrate the use of this template. {| ! Wiki markup ! !colspan=4| Tables
 * rowspan=2|
 * rowspan=2|
 * width=100|
 * Without extra code
 * width=100|
 * With
 * With
 * With
 * With
 * With
 * With
 * With
 * With


 * With  and
 * }
 * }

This template uses Module:Math and Template:ntsh, and produces a sort compatible with Template:nts and Template:ntsh.

TemplateData
{	"params": { "1": {			"label": "1st_number", "description": "The first number displayed representing the base value", "type": "number", "required": true },		"2": {			"label": "2nd_number", "description": "The second number displayed representing the object value", "type": "number" },		"dec": { "description": "Number of decimal places to round the percentage change to", "type": "number" },		"pre": { "description": "Prefix to the first and second numbers", "type": "string" },		"pre1": { "description": "Prefix to the first number", "type": "string" },		"pre2": { "description": "Prefix to the second number", "type": "string" },		"suf": { "description": "Suffix to the first and second numbers", "type": "string" },		"suf1": { "description": "Suffix to the first number", "type": "string" },		"suf2": { "description": "Suffix to the second number", "type": "string" },		"sort": { "description": "Adds or removes the -compatible sort key from the first two cells. The default is only to add this if a prefix or suffix is used (i.e. only if needed).", "suggestedvalues": [ "on", "off" ]		},		"italics": { "description": "Makes the output italic", "suggestedvalues": [ "on", "off" ],			"default": "off" },		"bold": { "description": "Makes the output bold", "suggestedvalues": [ "on", "off" ],			"default": "off" },		"invert": { "description": "Switches the base and object values in the calculation of percentage change", "suggestedvalues": [ "on", "off" ],			"default": "off" },		"align": { "description": "Adjusts the alignment of text in cells", "suggestedvalues": [ "center", "left", "right" ],			"default": "right" },		"rowspan": { "description": "Adjusts the row span of cells", "type": "number", "default": "1" },		"bgcolour": { "description": "Adjusts the background colour of cells, or by default, inherits from the table", "example": "lightblue", "default": "inherit" },		"disp": { "description": "This controls what is outputted. \"|dist=out\" produces the percentage change only (and thus the \"|align=\", \"|rowspan=\" and \"|=bgcolour\" parameters do not work with \"|disp=out\"). \"|disp=row\" produces three cells in a table row. ", "suggestedvalues": [ "out", "row" ],			"default": "row" }	},	"paramOrder": [ "1",		"2",		"dec", "pre", "pre1", "pre2", "suf", "suf1", "suf2", "sort", "italics", "bold", "invert", "align", "rowspan", "bgcolour", "disp" ] }

Tracking
Invalid input is tracked using WhatLinksHere for change/error.