• Home
  • Random
  • Nearby
  • Log in
  • Settings
Donate Now If Wikipedia is useful to you, please give today.
  • About Wikipedia
  • Disclaimers
Wikipedia

Template:Win draw lose/sandbox

  • Template
  • Talk
  • Language
  • Watch
  • Edit
< Template:Win draw lose
This is the template sandbox page for Template:Win draw lose (diff).
See also the companion subpage for test cases.
Template documentation[view] [edit] [history] [purge]
WarningThis template is used on approximately 7,700 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them.
Shortcut
  • {{WDLTemplate:WDL}}
This template uses Lua:
  • Module:WDL (sandbox)

Usage

edit

This template is for use within tables, and will automatically calculate a Win % There is the option to align the numbers by adding align= and then left/centre/right as required, and choose the number of decimal places by defining decimals=

For example, putting {{WDL|30|10|12|8}} within a table will display this. It will display trailing zeroes (e.g. the second and third case)

Record
P W D L Win %
30 10 12 8 033.33
100 10 1 89 010.00
100 100 0 0 100.00

To align the numbers to the right, use |align=right {{WDL|30|10|12|8|align=right}} within a table will display this. It will display trailing zeroes (e.g. the second and third case)

Record
P W D L Win %
30 10 12 8 033.33
100 10 1 89 010.00
100 100 0 0 100.00

There is also the option of adding in two goals columns before the percentage by using for= and against=. For example, {{WDL|100|10|1|89|for=112|against=88}} or {{WDL|100|10|1|89|for=112|against=88|diff=yes}}:

Record
P W D L GF GA Win %
100 10 1 89 112 88 010.00
Record
P W D L GF GA +/- Win %
100 10 1 89 112 88 +24 010.00

For a total column at the bottom use {{WDLtot}} in the same way.

Record
P W D L Win %
30 10 12 8 033.33
100 10 1 89 010.00
100 100 0 0 100.00
230 120 13 97 052.17

If the numbers of wins, losses and draws do not add up correctly, the page will appear in Category:WDL error.

Empty parameters

edit

If the first parameter is empty, the value for games played is computed from the sum of Wins Draws and Losses

Record
P W D L Win %
30 10 12 8 033.33
100 10 1 89 010.00
130 20 13 97 015.38

If any win, draw, or loss parameter is empty, the value is assumed to be zero when computing the percentage

Record
P W D L Win %
18 10 8 055.56
99 10 89 010.10
117 20 97 017.09
Record
P W D L Win %
18 10 8 055.56
99 10 89 010.10
117 20 97 017.09
Record
P W D L Win %
20 12 8 000.00
90 1 89 000.00
110 13 97 000.00

See also

edit
  • {{win-loss record}}
  • Category:WDL error - errors with the template appear in this category
The above documentation is transcluded from Template:Win draw lose/doc. (edit | history)
Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Win_draw_lose/sandbox&oldid=1261189889"
Last edited on 4 December 2024, at 19:32

Languages

      This page is not available in other languages.

      Wikipedia
      • Wikimedia Foundation
      • Powered by MediaWiki
      • This page was last edited on 4 December 2024, at 19:32 (UTC).
      • Content is available under CC BY-SA 4.0 unless otherwise noted.
      • Privacy policy
      • About Wikipedia
      • Disclaimers
      • Contact Wikipedia
      • Code of Conduct
      • Developers
      • Statistics
      • Cookie statement
      • Terms of Use
      • Desktop