Sjabloon:Chg/doc
Naar navigatie springen
Naar zoeken springen
40px | This is a documentation subpage for Sjabloon:Chg. It contains usage information, categories, interlanguage links and other content that is not part of the original sjabloon page. |
Use
This template calculates the percent change between two real number values and displays the result in a selectable format.
The syntax for this template is: {{chg|var1|var2|dec=2|color=yes|sort=yes}} where:
- var1 = real number — representing the base value
- var2 = real number — representing the object value
- dec= integer number — decimal places to display in percent change (default=2)
- color=yes — display percent change in the following colors: (default)
- gain in green
- default color
- loss in red
- color=no — display percent change in default color
- sort=yes — add a hidden sort key prefix (default)
- sort=no — don’t add a hidden sort key prefix
The following sortable table illustrates the use of this template.
Region | Wikitext | default | dec=0 | color=no | sort=no |
---|---|---|---|---|---|
Big Meadow | {{chg|1830000|1900679.75}} | +{{#invoke:Math|precision_format| 3.862281420765 | 2}}% | +{{#invoke:Math|precision_format| 3.862281420765 | 0}}% | +{{#invoke:Math|precision_format| 3.862281420765 | 2}}% | +{{#invoke:Math|precision_format| 3.862281420765 | 2}}% |
Mount Acme | {{chg|2450000|2205678.37}} | {{#invoke:Math|precision_format| -9.9723114285714 | 2}}% | {{#invoke:Math|precision_format| -9.9723114285714 | 0}}% | {{#invoke:Math|precision_format| -9.9723114285714 | 2}}% | {{#invoke:Math|precision_format| -9.9723114285714 | 2}}% |
Homeport | {{chg|5120000|5589462.60}} | +{{#invoke:Math|precision_format| 9.16919140625 | 2}}% | +{{#invoke:Math|precision_format| 9.16919140625 | 0}}% | +{{#invoke:Math|precision_format| 9.16919140625 | 2}}% | +{{#invoke:Math|precision_format| 9.16919140625 | 2}}% |
Longwood | {{chg|930000|930027.92}} | +{{#invoke:Math|precision_format| 0.0030021505376343 | 2}}% | +{{#invoke:Math|precision_format| 0.0030021505376343 | 0}}% | +{{#invoke:Math|precision_format| 0.0030021505376343 | 2}}% | +{{#invoke:Math|precision_format| 0.0030021505376343 | 2}}% |
Meadowbrook | {{chg|2450000|2450000.00}} | ±{{#invoke:Math|precision_format| 0 | 2}}% | ±{{#invoke:Math|precision_format| 0 | 0}}% | ±{{#invoke:Math|precision_format| 0 | 2}}% | ±{{#invoke:Math|precision_format| 0 | 2}}% |
Johnstown | {{chg|3400000|3902340.05}} | +{{#invoke:Math|precision_format| 14.774707352941 | 2}}% | +{{#invoke:Math|precision_format| 14.774707352941 | 0}}% | +{{#invoke:Math|precision_format| 14.774707352941 | 2}}% | +{{#invoke:Math|precision_format| 14.774707352941 | 2}}% |
Lakewood | {{chg|2250000|2236005.56}} | {{#invoke:Math|precision_format| -0.62197511111111 | 2}}% | {{#invoke:Math|precision_format| -0.62197511111111 | 0}}% | {{#invoke:Math|precision_format| -0.62197511111111 | 2}}% | {{#invoke:Math|precision_format| -0.62197511111111 | 2}}% |
Fox Hollow | {{chg|1180000|1190345.32}} | +{{#invoke:Math|precision_format| 0.8767220338983 | 2}}% | +{{#invoke:Math|precision_format| 0.8767220338983 | 0}}% | +{{#invoke:Math|precision_format| 0.8767220338983 | 2}}% | +{{#invoke:Math|precision_format| 0.8767220338983 | 2}}% |
Riverton | {{chg|10550000|11236005.55}} | +{{#invoke:Math|precision_format| 6.5024222748815 | 2}}% | +{{#invoke:Math|precision_format| 6.5024222748815 | 0}}% | +{{#invoke:Math|precision_format| 6.5024222748815 | 2}}% | +{{#invoke:Math|precision_format| 6.5024222748815 | 2}}% |
Timber Creek | {{chg|1360000|1310948.30}} | {{#invoke:Math|precision_format| -3.6067426470588 | 2}}% | {{#invoke:Math|precision_format| -3.6067426470588 | 0}}% | {{#invoke:Math|precision_format| -3.6067426470588 | 2}}% | {{#invoke:Math|precision_format| -3.6067426470588 | 2}}% |
Terminated | {{chg|1500|0.00}} | {{#invoke:Math|precision_format| -100 | 2}}% | {{#invoke:Math|precision_format| -100 | 0}}% | {{#invoke:Math|precision_format| -100 | 2}}% | {{#invoke:Math|precision_format| -100 | 2}}% |
Upstart | {{chg|0|26250.50}} | NA | NA | NA | NA |
See also
- This template invokes {{Nk}}
- The {{change}} and {{change2}} templates are the base for this one, but color the text, not the background