Template:Changes
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|...|number20are up to 20 numbers. If a number is not known, use NA or  order=is an optional change calculation order:order=acalculate percent change in ascending order. (default)order=dcalculate 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 Template:Change for a similar template for only two numbers but more options.
- For help with this template, please post a comment on the template talk page with a
{{reply to}}one or more of the previous editors.
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.