Template:SortMid
Summary[edit]
In Arena, Daggerfall and Morrowind, weapons do not have a singular base damage and, instead, has a range of possible values. These values, when presented in a sortable table, are often sorted alphabetically, instead of numerically.
This typically results in sorting by the min-value first, then sorting by the max-value. For example, a range of 1-10 is presented as less damaging than a range of 2-4. Furthermore, when min-values are a mix of single- and double-digit number, min-values like 10 or 11 would incorrectly precede values like 8 or 9.
This template allows number ranges in table cells to be sorted by their midpoint, that is, the average between the min-value and the max-value.
Parameters[edit]
Parameter | Scope | Description |
---|---|---|
1 or min | optional | The min-value; defaults to 0. |
2 or max | optional | The max-value; defaults to the min-value. |
3 or round | optional | The number of decimal places to which the average is rounded; defaults to 1. |
Examples[edit]
Default Sorting[edit]
!{{Anchor|Dwarven Long bow}} |[[File:DF-icon-weapon-Dwarven Long Bow.png|100px]] |6-20||8-22||960||1.00
Picture | Damage (actual) |
Damage (displayed) |
Value (gold) |
Weight (kg) |
|
---|---|---|---|---|---|
Iron Long bow | ![]() |
3-17 | 2-16 | 60 | 1.50 |
Steel Long bow | ![]() |
4-18 | 4-18 | 120 | 1.75 |
Silver Long bow | ![]() |
4-18 | 4-18 | 240 | 1.50 |
Elven Long bow | ![]() |
5-19 | 6-20 | 460 | 1.50 |
Dwarven Long bow | ![]() |
6-20 | 8-22 | 960 | 1.00 |
Mithril Long bow | ![]() |
7-21 | 10-24 | 1920 | 1.50 |
Adamantium Long bow | ![]() |
7-21 | 10-24 | 3840 | 1.50 |
Ebony Long bow | ![]() |
8-22 | 12-26 | 7680 | 0.75 |
Orcish Long bow | ![]() |
9-23 | 14-28 | 15360 | 1.50 |
Daedric Long bow | ![]() |
10-24 | 16-30 | 30720 | 1.75 |
Sorting with Template[edit]
!{{Anchor|Dwarven Long bow}} |[[File:DF-icon-weapon-Dwarven Long Bow.png|100px]] |{{SortMid|6|20}}||{{SortMid|8|22}}||960||1.00
Picture | Damage (actual) |
Damage (displayed) |
Value (gold) |
Weight (kg) |
|
---|---|---|---|---|---|
Iron Long bow | ![]() |
3-17 | 2-16 | 60 | 1.50 |
Steel Long bow | ![]() |
4-18 | 4-18 | 120 | 1.75 |
Silver Long bow | ![]() |
4-18 | 4-18 | 240 | 1.50 |
Elven Long bow | ![]() |
5-19 | 6-20 | 460 | 1.50 |
Dwarven Long bow | ![]() |
6-20 | 8-22 | 960 | 1.00 |
Mithril Long bow | ![]() |
7-21 | 10-24 | 1920 | 1.50 |
Adamantium Long bow | ![]() |
7-21 | 10-24 | 3840 | 1.50 |
Ebony Long bow | ![]() |
8-22 | 12-26 | 7680 | 0.75 |
Orcish Long bow | ![]() |
9-23 | 14-28 | 15360 | 1.50 |
Daedric Long bow | ![]() |
10-24 | 16-30 | 30720 | 1.75 |