Πρότυπο:Change/τεκμηρίωση

Από τη Βικιπαίδεια, την ελεύθερη εγκυκλοπαίδεια
Πήδηση στην πλοήγηση Πήδηση στην αναζήτηση

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}} !B9700381729571 +10.286,23% !B9700381729571 +10.286% !B9700381729571 +10.286,23% +10.286,23%
Mount Acme {{change|2450000|2205678.37}} !B9678800314551 +8.902,77% !B9678800314551 +8.903% !B9678800314551 +8.902,77% +8.902,77%
Homeport {{change|5120000|5589462.60}} !B9699878673886 +10.816,92% !B9699878673886 +10.817% !B9699878673886 +10.816,92% +10.816,92%
Longwood {{change|930000|930027.92}} !B9677738287096 +9.900,30% !B9677738287096 +9.900% !B9677738287096 +9.900,30% +9.900,30%
Meadowbrook {{change|2450000|2450000.00}} !B9954048801498 +9.900,00% !B9954048801498 +9.900% !B9954048801498 +9.900,00% +9.900,00%
Johnstown {{change|3400000|3902340.05}} !B9699373437353 +11.377,47% !B9699373437353 +11.377% !B9699373437353 +11.377,47% +11.377,47%
Lakewood {{change|2250000|2236005.56}} !B9677801614292 +9.837,80% !B9677801614292 +9.838% !B9677801614292 +9.837,80% +9.837,80%
Fox Hollow {{change|1180000|1190345.32}} !B9677650422382 +9.987,67% !B9677650422382 +9.988% !B9677650422382 +9.987,67% +9.987,67%
Riverton {{change|10550000|11236005.55}} !B9700128300644 +10.550,24% !B9700128300644 +10.550% !B9700128300644 +10.550,24% +10.550,24%
Timber Creek {{change|1360000|1310948.30}} !B9678109709857 +9.539,33% !B9678109709857 +9.539% !B9678109709857 +9.539,33% +9.539,33%
Terminated {{change|1500|0.00}} !I −100,00% !I −100% !I −100,00% −100,00%
Upstart {{change|0|26250.50}} !O NA !O NA !O NA NA

See also[επεξεργασία κώδικα]

  • This template invokes Template:Change2, which is a simplified version of this template.
  • This template also invokes Template:Nk
  • The Template:Chg works similarly, but colors the background of table cells, not the text