টেমপ্লেট:Change

উইকিপিডিয়া, মুক্ত বিশ্বকোষ থেকে
পরিভ্রমণে ঝাঁপ দিন অনুসন্ধানে ঝাঁপ দিন
টেমপ্লেট নথি[দেখুন] [সম্পাদনা] [ইতিহাস] [শোধন]

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 No.|2nd No.|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}}

parameter function
1 1st No. is the first number displayed representing the base value.
2 2nd No. is the second number displayed representing the object value.
dec This is the number of decimal places to round the percentage change to.
pre This adds a prefix to the first and second numbers.
pre1 This adds a prefix to the first number.
pre2 This adds a prefix to the second number.
suf This adds a suffix to the first and second numbers.
suf1 This adds a suffix to the first number.
suf2 This adds a suffix to the second number.
sort This 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).
italics This can either have the value of on or off. italics=on makes the output italic. The default is italics=off.
bold This can either have the value of on or off. bolds=on makes the output bold. The default is bold=off.
invert This can either have the value of on or off. invert=on switches the base and object values in the calculation of percentage change. The default is invert=off.
align This adjusts the alignment of text in cells. align=center and align=left aligns the text to the centre and left respectively. The default is align=right.
rowspan This adjust the row span of cells. The default is rowspan=1.
bgcolour This adjusts the background colour of cells. The default is bgcolour=#F9F9F9 (light grey).
disp This controls what is output. disp=out produces the percentage change only (and thus align, rowspan and bgcolour do not work with disp=out). The default is disp=row which produces three cells in a table row.

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}}
|-
|}
Without extra code
Region first second change
Big Meadow টেমপ্লেট:Change/rowIoffSoff
Little Meadow টেমপ্লেট:Change/rowIoffSoff
Mount Acme টেমপ্লেট:Change/rowIoffSoff
Acmevale North টেমপ্লেট:Change/rowIoffSoff
Acmevale South
Homeport টেমপ্লেট:Change/rowIoffSoff
Longwood টেমপ্লেট:Change/rowIoffSoff
Meadowbrook টেমপ্লেট:Change/rowIoffSon
Johnstown টেমপ্লেট:Change/rowIoffSon
Lakewood টেমপ্লেট:Change/rowIoffSoff
Fox Hollow টেমপ্লেট:Change/rowIoffSoff
Riverton টেমপ্লেট:Change/rowIoffSoff
Timber Creek টেমপ্লেট:Change/rowIoffSoff
Terminated টেমপ্লেট:Change/rowIoffSoff
Upstart টেমপ্লেট:Change/rowIoffSoff
With |disp=out
Region change
Big Meadow &10000000000000003862281+৩.৮৬%
Little Meadow &10000000000000025000000+২৫�00%
Mount Acme &09999999999999990027688−৯.৯৭%
Acmevale North &09999999999999979999999−২০�00%
Acmevale South
Homeport &10000000000000009169191+৯%
Longwood &10000000000000000003002+০.০০৩%
Meadowbrook ০�00%
Johnstown &10000000000000014774707+১৪.৭৭%
Lakewood &09999999999999999378024−০.৬২%
Fox Hollow &10000000000000000876722+০.৮৮%
Riverton &10000000000000006502422+৬.৫0%
Timber Creek &09999999999999996393257−৩.৬১%
Terminated &09999999999999899999999−১০০�00%
Upstart NA
With |invert=on
Region first second change
Big Meadow ১৮,৩০,০০০ ১৯,০০,৬৭৯.৭৫ &09999999999999996281343−৩.৭২%
Little Meadow ৪,০০,০০০ ৫,০০,০০০ &09999999999999979999999−২০�00%
Mount Acme ২৪,৫০,০০০ ২২,০৫,৬৭৮.৩৭ &10000000000000011076938+১১.০৮%
Acmevale North ১২,৫০,০০০ ১০,০০,০০০ &10000000000000025000000+২৫�00%
Acmevale South
Homeport ৫১,২০,০০০ ৫৫,৮৯,৪৬২.৬০ &09999999999999991600934−৮%
Longwood ৯,৩০,০০০ ৯,৩০,০২৭.৯২ &09999999999999999996997−০.০০৩%
Meadowbrook টেমপ্লেট:Change/rowIonSon
Johnstown টেমপ্লেট:Change/rowIonSon
Lakewood ২২,৫০,০০০ ২২,৩৬,০০৫.৫৬ &10000000000000000625867+০.৬৩%
Fox Hollow ১১,৮০,০০০ ১১,৯০,৩৪৫.৩২ &09999999999999999130897−০.৮৭%
Riverton ১,০৫,৫০,০০০ ১,১২,৩৬,০০৫.৫৫ &09999999999999993894578−৬.১১%
Timber Creek ১৩,৬০,০০০ ১৩,১০,৯৪৮.৩০ &10000000000000003741695+৩.৭৪%
Terminated ১,৫০০ ০.০০ NA
Upstart ২৬,২৫০.৫০ &09999999999999899999999−১০০�00%
With |invert=on and |disp=out
Region change
Big Meadow টেমপ্লেট:Change/outIonSoff
Little Meadow টেমপ্লেট:Change/outIonSoff
Mount Acme টেমপ্লেট:Change/outIonSoff
Acmevale North টেমপ্লেট:Change/outIonSoff
Acmevale South
Homeport টেমপ্লেট:Change/outIonSoff
Longwood টেমপ্লেট:Change/outIonSoff
Meadowbrook ০�00%
Johnstown &09999999999999987127209−১২.৮৭%
Lakewood টেমপ্লেট:Change/outIonSoff
Fox Hollow টেমপ্লেট:Change/outIonSoff
Riverton টেমপ্লেট:Change/outIonSoff
Timber Creek টেমপ্লেট:Change/outIonSoff
Terminated টেমপ্লেট:Change/outIonSoff
Upstart টেমপ্লেট:Change/outIonSoff

This template uses Module:Math and Template:ntsh, and produces a sort compatible with Template:nts and Template:ntsh.