Difference between revisions of "Template:Meat range"

From TheKolWiki
Jump to: navigation, search
m
m (Examples: there we go)
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{#switch:{{{1|?}}}|!=Indeterminate|?=''unknown''|0|none|None=None|#default={{formatnum:{{ceiling|{{#expr:.8*{{{1}}}}}}}}}-{{formatnum:{{floor|{{#expr:1.2*{{{1}}}}}}}}}}}}}</includeonly><noinclude>
+
<includeonly>{{#switch:{{{1|?}}}|!=Indeterminate|?|=''unknown''|0|none|None=None|#default={{formatnum:{{min|{{#expr:{{{1}}}-1}}|{{#expr:ceil (.8*{{{1}}})}}}}}}-{{formatnum:{{max|{{#expr:{{{1}}}+1}}|{{#expr:floor (1.2*{{{1}}})}}}}}}}}</includeonly><noinclude>
 
{{Code2}}
 
{{Code2}}
 
Helper template for constructing a range of meat drops from the given average.  Can be used for other things, provided they are triangular and range from 80% to 120% of the average value (round up and down respectively).
 
Helper template for constructing a range of meat drops from the given average.  Can be used for other things, provided they are triangular and range from 80% to 120% of the average value (round up and down respectively).
Line 8: Line 8:
 
*<nowiki>{{meat range}}</nowiki>
 
*<nowiki>{{meat range}}</nowiki>
 
{{meat range}}
 
{{meat range}}
 +
*&#123;{meat range|}}
 +
{{meat range|}}
 
*<nowiki>{{meat range|0}}</nowiki>
 
*<nowiki>{{meat range|0}}</nowiki>
 
{{meat range|0}}
 
{{meat range|0}}
 
*<nowiki>{{meat range|1111}}</nowiki>
 
*<nowiki>{{meat range|1111}}</nowiki>
 
{{meat range|1111}}
 
{{meat range|1111}}
 +
*&#123;{meat range|3}}
 +
{{meat range|3}}
  
 
[[Category:Utility Templates|{{PAGENAME}}]]</noinclude>
 
[[Category:Utility Templates|{{PAGENAME}}]]</noinclude>

Latest revision as of 23:06, 11 August 2011

{{Meat range}}
{{#switch:{{{1|?}}}|!=Indeterminate|?|=''unknown''|0|none|None=None|#default={{formatnum:{{min|{{#expr:{{{1}}}-1}}|{{#expr:ceil (.8*{{{1}}})}}}}}}-{{formatnum:{{max|{{#expr:{{{1}}}+1}}|{{#expr:floor (1.2*{{{1}}})}}}}}}}}

Helper template for constructing a range of meat drops from the given average. Can be used for other things, provided they are triangular and range from 80% to 120% of the average value (round up and down respectively).

Examples

  • {{meat range|30}}

24-36

  • {{meat range}}

unknown

  • {{meat range|}}

unknown

  • {{meat range|0}}

None

  • {{meat range|1111}}

889-1,333

  • {{meat range|3}}

2-4