Difference between revisions of "Template:Net worth table"

From Ballotpedia
Jump to: navigation, search
Line 7: Line 7:
 
-->{{#if:{{{Year 5|}}}|<tr><td style="text-align:center">{{{Year 5}}}</td><td style="text-align:center">${{formatnum:{{{Average 5|0}}}}}</td><td style="text-align:center">{{#ifexpr:{{{Average 4|}}} = 0|N/A|{{#ifexpr:{{{Average 4|}}} > 0|{{formatnum:{{#expr:(({{{Average 5|0}}} - {{{Average 4|0}}})/{{{Average 4|0}}}*100)round2}}}}|{{formatnum:{{#expr:(({{{Average 5|0}}} - {{{Average 4|0}}})/{{{Average 4|0}}}*-100)round2}}}}}}%}}</td></tr>|}}<!--
 
-->{{#if:{{{Year 5|}}}|<tr><td style="text-align:center">{{{Year 5}}}</td><td style="text-align:center">${{formatnum:{{{Average 5|0}}}}}</td><td style="text-align:center">{{#ifexpr:{{{Average 4|}}} = 0|N/A|{{#ifexpr:{{{Average 4|}}} > 0|{{formatnum:{{#expr:(({{{Average 5|0}}} - {{{Average 4|0}}})/{{{Average 4|0}}}*100)round2}}}}|{{formatnum:{{#expr:(({{{Average 5|0}}} - {{{Average 4|0}}})/{{{Average 4|0}}}*-100)round2}}}}}}%}}</td></tr>|}}<!--
  
-->{{#if:{{{Year 4|}}}|<tr><td style="text-align:center">{{{Year 4}}}</td><td style="text-align:center">${{formatnum:{{{Average 4|0}}}}}</td><td style="text-align:center">{{#ifexpr:{{{Average 3|}}} > 0|{{formatnum:{{#expr:(({{{Average 4|0}}} - {{{Average 3|0}}})/{{{Average 3|0}}}*100)round2}}}}|{{formatnum:{{#expr:(({{{Average 4|0}}} - {{{Average 3|0}}})/{{{Average 3|0}}}*-100)round2}}}}}}%</td></tr>|}}<!--
+
-->{{#if:{{{Year 4|}}}|<tr><td style="text-align:center">{{{Year 4}}}</td><td style="text-align:center">${{formatnum:{{{Average 4|0}}}}}</td><td style="text-align:center">{{#ifexpr:{{{Average 3|}}} = 0|N/A|{{#ifexpr:{{{Average 3|}}} > 0|{{formatnum:{{#expr:(({{{Average 4|0}}} - {{{Average 3|0}}})/{{{Average 3|0}}}*100)round2}}}}|{{formatnum:{{#expr:(({{{Average 4|0}}} - {{{Average 3|0}}})/{{{Average 3|0}}}*-100)round2}}}}}}%}}</td></tr>|}}<!--
  
-->{{#if:{{{Year 3|}}}|<tr><td style="text-align:center">{{{Year 3}}}</td><td style="text-align:center">${{formatnum:{{{Average 3|0}}}}}</td><td style="text-align:center">{{#ifexpr:{{{Average 2|}}} > 0|{{formatnum:{{#expr:(({{{Average 3|0}}} - {{{Average 2|0}}})/{{{Average 2|0}}}*100)round2}}}}|{{formatnum:{{#expr:(({{{Average 3|0}}} - {{{Average 2|0}}})/{{{Average 2|0}}}*-100)round2}}}}}}%</td></tr>|}}<!--
+
-->{{#if:{{{Year 3|}}}|<tr><td style="text-align:center">{{{Year 3}}}</td><td style="text-align:center">${{formatnum:{{{Average 3|0}}}}}</td><td style="text-align:center">{{#ifexpr:{{{Average 2|}}} = 0|N/A|{{#ifexpr:{{{Average 2|}}} > 0|{{formatnum:{{#expr:(({{{Average 3|0}}} - {{{Average 2|0}}})/{{{Average 2|0}}}*100)round2}}}}|{{formatnum:{{#expr:(({{{Average 3|0}}} - {{{Average 2|0}}})/{{{Average 2|0}}}*-100)round2}}}}}}%}}</td></tr>|}}<!--
  
-->{{#if:{{{Year 2|}}}|<tr><td style="text-align:center">{{{Year 2}}}</td><td style="text-align:center">${{formatnum:{{{Average 2|0}}}}}</td><td style="text-align:center">{{#ifexpr:{{{Average 1|}}} > 0|{{formatnum:{{#expr:(({{{Average 2|0}}} - {{{Average 1|0}}})/{{{Average 1|0}}}*100)round2}}}}|{{formatnum:{{#expr:(({{{Average 2|0}}} - {{{Average 1|0}}})/{{{Average 1|0}}}*-100)round2}}}}}}%</td></tr>|}}<!--
+
-->{{#if:{{{Year 2|}}}|<tr><td style="text-align:center">{{{Year 2}}}</td><td style="text-align:center">${{formatnum:{{{Average 2|0}}}}}</td><td style="text-align:center">{{#ifexpr:{{{Average 1|}}} = 0|N/A|{{#ifexpr:{{{Average 1|}}} > 0|{{formatnum:{{#expr:(({{{Average 2|0}}} - {{{Average 1|0}}})/{{{Average 1|0}}}*100)round2}}}}|{{formatnum:{{#expr:(({{{Average 2|0}}} - {{{Average 1|0}}})/{{{Average 1|0}}}*-100)round2}}}}}}%}}</td></tr>|}}<!--
  
 
-->{{#if:{{{Year 1|}}}|<tr><td style="text-align:center">{{{Year 1}}}</td><td style="text-align:center">${{formatnum:{{{Average 1|0}}}}}</td><td style="text-align:center">N/A</td></tr>|}}
 
-->{{#if:{{{Year 1|}}}|<tr><td style="text-align:center">{{{Year 1}}}</td><td style="text-align:center">${{formatnum:{{{Average 1|0}}}}}</td><td style="text-align:center">N/A</td></tr>|}}
 
</table><noinclude>{{Documentation}}{{reflist}}[[Category:Congress templates]]</noinclude>
 
</table><noinclude>{{Documentation}}{{reflist}}[[Category:Congress templates]]</noinclude>

Revision as of 18:12, 14 January 2014

{{{Name}}} Yearly Net Worth
YearAvg. Net Worth% Difference from previous year
[edit] Template-info.png Template documentation

Usage

Copy and paste the code below and expand for as many years as necessary, up to 5.

{{Net worth table
|Collapse=
|Name =
|Political Party =
|Year 1 =
|Average 1 =
|Year 2 =
|Average 2 =
|Year 3 =
|Average 3 =
}}

Year 1 will be the oldest year of data you have. The table will automatically put the newest year of data first.

Example

NAME Yearly Net Worth
YearAvg. Net Worth% Difference from previous year
2014$10,00019,900%
2013$50112.5%
2012$-40098.92%
2011$-37,000-100.68%
2010$5,412,358N/A
Growth from 2010 to 2012:-100%