Difference between revisions of "Template:Change/doc"

From Ava Zinn Wiki
Jump to: navigation, search
[unchecked revision][unchecked revision]
(Use)
(Use)
Line 95: Line 95:
 
|align=right|{{change|1360000|1310948.30|color=no}}
 
|align=right|{{change|1360000|1310948.30|color=no}}
 
|align=right|{{change|1360000|1310948.30|sort=no}}
 
|align=right|{{change|1360000|1310948.30|sort=no}}
 +
|-
 +
|Terminated
 +
|<nowiki>{{change|1500|0.00}}</nowiki>
 +
|align=right|{{change|1500|0.00}}
 +
|align=right|{{change|1500|0.00|dec=0}}
 +
|align=right|{{change|1500|0.00|color=no}}
 +
|align=right|{{change|1500|0.00|sort=no}}
 +
|-
 +
|Upstart
 +
|<nowiki>{{change||26250.50}}</nowiki>
 +
|align=right|{{change||26250.50}}
 +
|align=right|{{change||26250.50|dec=0}}
 +
|align=right|{{change||26250.50|color=no}}
 +
|align=right|{{change||26250.50|sort=no}}
 
|-
 
|-
 
|}
 
|}

Revision as of 16:11, 7 December 2009

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:

{{change|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 of decimal places to display in percent change (default=2)
  • color=yes – display percent change in the following colors: (default)
    • gain in green
    • no change in 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 {{change|1830000|1900679.75}} +3.86% +4% +3.86% +3.86%
Mount Acme {{change|2450000|2205678.37}} −9.97% −10% −9.97% −9.97%
Homeport {{change|5120000|5589462.60}} +9.17% +9% +9.17% +9.17%
Longwood {{change|930000|930027.92}} 0.00% 0% 0.00% 0.00%
Meadowbrook {{change|2450000|2450000.00}} 0.00% 0% 0.00% 0.00%
Johnstown {{change|3400000|3902340.05}} +14.77% +15% +14.77% +14.77%
Lakewood {{change|2250000|2236005.56}} −0.62% −1% −0.62% −0.62%
Fox Hollow {{change|1180000|1190345.32}} +0.88% +1% +0.88% +0.88%
Riverton {{change|10550000|11236005.55}} +6.50% +7% +6.50% +6.50%
Timber Creek {{change|1360000|1310948.30}} −3.61% −4% −3.61% −3.61%
Terminated {{change|1500|0.00}} −100.00% −100% −100.00% −100.00%
Upstart {{change||26250.50}} NA NA NA NA

See also