Template:Drop Rate: Difference between revisions
(clean up and prettify a bit) |
(move formatnum into denominator to avoid parsing fraction) |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
<includeonly> | <includeonly>{{#ifexpr: {{{1}}} < 1 | ||
|0 | |0 | ||
|1/{{#ifexpr: {{{1}}} > {{{max|100000}}} | |1/{{#ifexpr: {{{1}}} > {{{max|100000}}} | ||
|1 | | {{#expr: {{{mod|1}}} }} | ||
| {{#expr: trunc {{#expr: {{{max|100000}}}/{{{1}}} | | {{formatnum: {{#expr: trunc {{#expr: ({{{mod|1}}} * {{{max|100000}}})/{{{1}}}}} | ||
}} | |||
}} | }} | ||
}} | }} | ||
Line 16: | Line 15: | ||
| <!-- Anonymous param. An integer amount for how many tickets an item has. If it is larger than the max ticket amount, calculation will be skipped and the output will say 1/1. --> | | <!-- Anonymous param. An integer amount for how many tickets an item has. If it is larger than the max ticket amount, calculation will be skipped and the output will say 1/1. --> | ||
|max <!-- An integer amount for the remaining ticket amount of a roll source. If omitted, this value is treated as 100000. --> | |max <!-- An integer amount for the remaining ticket amount of a roll source. If omitted, this value is treated as 100000. --> | ||
|mod <!-- An integer amount to modify the drop rate. Useful for things like shinies or mission-specific RDR boosts. If omitted, treated as 1. --> | |||
}} | }} | ||
</pre> | </pre> | ||
Line 26: | Line 26: | ||
<pre>{{Drop Rate|1|max=100000}}</pre> | <pre>{{Drop Rate|1|max=100000}}</pre> | ||
{{Drop Rate|1|max=100000}} | {{Drop Rate|1|max=100000}} | ||
=== | ===40 Tickets, 100k Max Tickets=== | ||
<pre>{{Drop Rate| | <pre>{{Drop Rate|40|max=100000}}</pre> | ||
{{Drop Rate|15|max= | {{Drop Rate|40|max=100000}} | ||
===40 Tickets, 100/15 Mod=== | |||
<pre>{{Drop Rate|40|mod=100/15}}</pre> | |||
{{Drop Rate|40|mod=100/15}} | |||
===40 Tickets, 99740 Max Tickets, 100/15 Mod=== | |||
<pre>{{Drop Rate|40|max=99740|mod=100/15}}</pre> | |||
{{Drop Rate|40|max=99740|mod=100/15}} | |||
===1 Ticket, 1 Max Ticket=== | ===1 Ticket, 1 Max Ticket=== | ||
<pre>{{Drop Rate|1|max=1}}</pre> | <pre>{{Drop Rate|1|max=1}}</pre> | ||
Line 35: | Line 41: | ||
<pre>{{Drop Rate|100|max=1}}</pre> | <pre>{{Drop Rate|100|max=1}}</pre> | ||
{{Drop Rate|100|max=1}} | {{Drop Rate|100|max=1}} | ||
===40 Tickets, 1 Max Tickets, 100/15 Mod=== | |||
<pre>{{Drop Rate|40|max=1|mod=100/15}}</pre> | |||
{{Drop Rate|40|max=1|mod=100/15}} | |||
===0 Tickets, 1 Max Ticket=== | ===0 Tickets, 1 Max Ticket=== | ||
<pre>{{Drop Rate|0|max=1}}</pre> | <pre>{{Drop Rate|0|max=1}}</pre> |
Latest revision as of 10:21, 10 January 2025
Purpose
Shortcut template for converting any ticket amount into a drop rate. All decimals in the output are truncated.
Parameter List
{{Drop Rate | <!-- Anonymous param. An integer amount for how many tickets an item has. If it is larger than the max ticket amount, calculation will be skipped and the output will say 1/1. --> |max <!-- An integer amount for the remaining ticket amount of a roll source. If omitted, this value is treated as 100000. --> |mod <!-- An integer amount to modify the drop rate. Useful for things like shinies or mission-specific RDR boosts. If omitted, treated as 1. --> }}
Examples
1 Ticket, Undefined Max Tickets
{{Drop Rate|1}}
1/100,000
1 Ticket, 100k Max Tickets
{{Drop Rate|1|max=100000}}
1/100,000
40 Tickets, 100k Max Tickets
{{Drop Rate|40|max=100000}}
1/2,500
40 Tickets, 100/15 Mod
{{Drop Rate|40|mod=100/15}}
1/16,666
40 Tickets, 99740 Max Tickets, 100/15 Mod
{{Drop Rate|40|max=99740|mod=100/15}}
1/16,623
1 Ticket, 1 Max Ticket
{{Drop Rate|1|max=1}}
1/1
100 Tickets, 1 Max Ticket
{{Drop Rate|100|max=1}}
1/1
40 Tickets, 1 Max Tickets, 100/15 Mod
{{Drop Rate|40|max=1|mod=100/15}}
1/6.6666666666667
0 Tickets, 1 Max Ticket
{{Drop Rate|0|max=1}}
0
"A" Tickets, 1 Max Ticket
{{Drop Rate|A|max=1}}
Expression error: Unrecognised word "a".