Template:Change
| This template uses Lua: |
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.
{{change
| ''1st_number''
| ''2nd_number''
| dec = ''rounding''
| pre = ''prefix''
| suf = ''suffix''
| sort = ''on/off''
| italics = ''on/off''
| bold = ''on/off''
| invert = ''on/off''
| disp = ''row/out''
| rowspan = ''rowspan''
| align = ''alignment''
| bgcolour = ''background colour''
}}
Examples
The following sortable tables illustrate the use of this template.
| Wiki markup | Tables | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
{|class="wikitable sortable"
!Region
!first
!second
!change
|-
|Big Meadow
|{{change|1830000|1900679.75}}
|-
|Little Meadow
|{{change|400000|500000}}
|-
|Mount Acme
|{{change|2450000|2205678.37}}
|-
|Acmevale North
|{{change|1250000|1000000
|rowspan=2}}
|-
|Acmevale South
|-
|Homeport
|{{change|5120000|5589462.60
|dec=0}}
|-
|Longwood
|{{change|930000|930027.92
|dec=3}}
|-
|Meadowbrook
|{{change|2450000|2450000.00
|pre=$}}
|-
|Johnstown
|{{change|3400000|3902340.05
|suf= kg}}
|-
|Lakewood
|{{change|2250000|2236005.56
|align=center}}
|- style="background-color:lightblue"
| Fox Hollow
|{{change|1180000|1190345.32
|bgcolour=lightblue}}
|-
|Riverton
|{{change|10550000|11236005.55
|bold=on}}
|-
|Timber Creek
|{{change|1360000|1310948.30
|italics=on}}
|-
|Terminated
|{{change|1500|0.00|bold=on
|italics=on}}
|-
|Upstart
|{{change|0|26250.50
|align=left}}
|-
|}
|
|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This template uses Module:Math and Template:ntsh, and produces a sort compatible with Template:nts and Template:ntsh.
TemplateData
TemplateData for Change
No description.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| 1st_number | 1 | The first number displayed representing the base value | Number | required |
| 2nd_number | 2 | The second number displayed representing the object value | Number | optional |
| dec | dec | Number of decimal places to round the percentage change to | Number | optional |
| pre | pre | Prefix to the first and second numbers | String | optional |
| pre1 | pre1 | Prefix to the first number | String | optional |
| pre2 | pre2 | Prefix to the second number | String | optional |
| suf | suf | Suffix to the first and second numbers | String | optional |
| suf1 | suf1 | Suffix to the first number | String | optional |
| suf2 | suf2 | Suffix to the second number | String | optional |
| sort | sort | Adds or removes the {{nts}}-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).
| Unknown | optional |
| italics | italics | Makes the output italic
| Unknown | optional |
| bold | bold | Makes the output bold
| Unknown | optional |
| invert | invert | Switches the base and object values in the calculation of percentage change
| Unknown | optional |
| align | align | Adjusts the alignment of text in cells
| Unknown | optional |
| rowspan | rowspan | Adjusts the row span of cells
| Number | optional |
| bgcolour | bgcolour | Adjusts the background colour of cells, or by default, inherits from the table
| Unknown | optional |
| disp | disp | 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.
| Unknown | optional |
Tracking
Invalid input is tracked using WhatLinksHere for {{change/error}}.
See also
- Template:Changes compares up to 20 numbers in either ascending or descending order.
- 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.