Template talk:Indexlist/body: Difference between revisions
mNo edit summary |
Thespeon196 (talk | contribs) (relink after page move) |
||
Line 1: | Line 1: | ||
Something seems wrong with this template, it makes [[List of Pokémon by index number | Something seems wrong with this template, it makes [[List of Pokémon by index number in Generation V|every Pokémon after Torchic fail at maths]]. 90+90=10, what? [[User:Bluesun|Bluesun]] 21:09, 10 November 2010 (UTC) | ||
:Just noticed this myself, and I have the explanation and fix as well. The cause is an error in the code for the second digit, which causes it not to show up for index numbers >= 256. The first and third digits appear padded with a 0. For the fix, we just need to replace | :Just noticed this myself, and I have the explanation and fix as well. The cause is an error in the code for the second digit, which causes it not to show up for index numbers >= 256. The first and third digits appear padded with a 0. For the fix, we just need to replace | ||
<code><nowiki>{{padleft:{{#switch: {{#expr: floor({{{1|0}}} div 256)}}|0=0|1=1|2=2|3=3|4=4|5=5|6=6|7=7|8=8|9=9|10=A|11=B|12=C|13=D|14=E|15=F}}{{#switch: {{#expr: floor({{{1|0}}} div 16)}}|0=0|1=1|2=2|3=3|4=4|5=5|6=6|7=7|8=8|9=9|10=A|11=B|12=C|13=D|14=E|15=F}}{{#switch: {{#expr: {{{1|0}}} mod 16}}|0=0|1=1|2=2|3=3|4=4|5=5|6=6|7=7|8=8|9=9|10=A|11=B|12=C|13=D|14=E|15=F}}|3}}</nowiki></code> | <code><nowiki>{{padleft:{{#switch: {{#expr: floor({{{1|0}}} div 256)}}|0=0|1=1|2=2|3=3|4=4|5=5|6=6|7=7|8=8|9=9|10=A|11=B|12=C|13=D|14=E|15=F}}{{#switch: {{#expr: floor({{{1|0}}} div 16)}}|0=0|1=1|2=2|3=3|4=4|5=5|6=6|7=7|8=8|9=9|10=A|11=B|12=C|13=D|14=E|15=F}}{{#switch: {{#expr: {{{1|0}}} mod 16}}|0=0|1=1|2=2|3=3|4=4|5=5|6=6|7=7|8=8|9=9|10=A|11=B|12=C|13=D|14=E|15=F}}|3}}</nowiki></code> |
Latest revision as of 21:50, 2 August 2024
Something seems wrong with this template, it makes every Pokémon after Torchic fail at maths. 90+90=10, what? Bluesun 21:09, 10 November 2010 (UTC)
- Just noticed this myself, and I have the explanation and fix as well. The cause is an error in the code for the second digit, which causes it not to show up for index numbers >= 256. The first and third digits appear padded with a 0. For the fix, we just need to replace
{{padleft:{{#switch: {{#expr: floor({{{1|0}}} div 256)}}|0=0|1=1|2=2|3=3|4=4|5=5|6=6|7=7|8=8|9=9|10=A|11=B|12=C|13=D|14=E|15=F}}{{#switch: {{#expr: floor({{{1|0}}} div 16)}}|0=0|1=1|2=2|3=3|4=4|5=5|6=6|7=7|8=8|9=9|10=A|11=B|12=C|13=D|14=E|15=F}}{{#switch: {{#expr: {{{1|0}}} mod 16}}|0=0|1=1|2=2|3=3|4=4|5=5|6=6|7=7|8=8|9=9|10=A|11=B|12=C|13=D|14=E|15=F}}|3}}
with
{{#switch: {{#expr: floor({{{1|0}}} div 256)}}|0=0|1=1|2=2|3=3|4=4|5=5|6=6|7=7|8=8|9=9|10=A|11=B|12=C|13=D|14=E|15=F}}{{#switch: {{#expr: floor({{{1|0}}} div 16) mod 16}}|0=0|1=1|2=2|3=3|4=4|5=5|6=6|7=7|8=8|9=9|10=A|11=B|12=C|13=D|14=E|15=F}}{{#switch: {{#expr: {{{1|0}}} mod 16}}|0=0|1=1|2=2|3=3|4=4|5=5|6=6|7=7|8=8|9=9|10=A|11=B|12=C|13=D|14=E|15=F}}