Predloga:Max/5
0
![](http://upload.wikimedia.org/wikipedia/commons/thumb/4/43/Test_Template_Info-Icon_-_Version_%282%29.svg/50px-Test_Template_Info-Icon_-_Version_%282%29.svg.png)
Predloga:Max/5 vrača največje število izmed 5-tih parametrov, kjer se nakateri parametre lahko ignorirajo zaradi neštevilčne vrednosti (kot je to parameter z vrednostjo "none" ali "n/a" ali "-").
- Uporaba: {{max/5 | 1 | 6 | 4 | 7 | 3 }} → 7
- {{max/5 |24|65|(izpusti)|4|none}} → 65
- {{max/5 | -7 |-4 |-1 |-6 | -9 }} → -1
- {{max/5 | | 34 | | | 31 }} → 34
- Uporaba: {{max/5 | 1 | 6 | 4 | 7 | 3 }} → 7
To set a floor amount, as a minimum result, also pass a specified amount, such as "50" where {{max/5|1|2|3|4|50}} will return at least 50 as the maximum. Otherwise, negative numbers are allowed, to find the highest among negative numbers, when all negative.
- Peformance considerations
This template, in turn, uses Predloga:Max/3 and Predloga:Max/2 to find the maximum among two groups of 3 and 2 parameters, but it also skips any invalid or text data in the entries, such as "(izpusti)" or "n/a" or "--" or "none" etc. Hence, only the numeric parameters are compared, not the text words.
The template-expansion depth is kept to a minimum, as 8 nesting levels, by avoiding deeply nested if-else-else-else structures.