Template talk:Indexlist/body

From Bulbapedia, the community-driven Pokémon encyclopedia.
Revision as of 21:50, 2 August 2024 by Thespeon196 (talk | contribs) (relink after page move)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

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)
Done. Jellotalk 04:18, 8 January 2011 (UTC)