Template:Percentage change

From OpenStreetMap Wiki
Jump to navigation Jump to search


This template can show the percentage values on background red for negative values and green for positive values. It is derived from Template:Progress.

The intensity of background color vary depending of the amount of variation, inside the +/- 5% it is light, inside the +/- 15% it is middle intensity and over 15% of variation it is intense.

How it will look like

Of course there will appear your percentage in front of the percent sign.

Range Display Comment
(empty) ? status unknown
below -15 -22% very negative
-5 to -15 -9% negative
less than 0 to -5 -2% barely negative
0 0% stable
more than 0 to 5 3% barely positive
5 to 15 12% positive
over 15 36% very positive

Usage

Everything before:

{|
  [...]
|-
| Something

This is the table cell having a coloured background:

| {{Template:Percentage change|[here comes your percentage]}}

Everything after:

| Something
  [...]
|}

The percentage can be an integer or a float. E.g. 11.2 works as well. The table cells after the template cannot be inserted on same line divided by double bar, so pay attention to insert a newline just after the template and restart the new line of the table with a single vertical bar.