Template talk:Indexlist/body: Difference between revisions
From Bulbapedia, the community-driven Pokémon encyclopedia.
Jump to navigationJump to search
(Combusken fails math?) |
Smithers888 (talk | contribs) (Fixed code to be updated by admin.) |
||
Line 1: | Line 1: | ||
Something seems wrong with this template, it makes [[List of Pokémon by index number (Generation V)|every Pokémon after Torchic fail at maths]]. 90+90=10, what? [[User:Bluesun|Bluesun]] 21:09, 10 November 2010 (UTC) | Something seems wrong with this template, it makes [[List of Pokémon by index number (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 | |||
:<pre>{{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}}</pre> | |||
:with | |||
:<pre>{{#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}}</pre> | |||
:Now we just need an admin to make the change. (Will someone read this here or do I need to contact them separately?) --[[User:Smithers888|<span style="color:#FF1111;">Smit</span><span style="color:#1111FF;">hers</span>]][[User talk:Smithers888|<span style="color:#FFD733;">888</span>]] 04:06, 8 January 2011 (UTC) |
Revision as of 04:06, 8 January 2011
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}}
- Now we just need an admin to make the change. (Will someone read this here or do I need to contact them separately?) --Smithers888 04:06, 8 January 2011 (UTC)