Open main menu

Bulbapedia β


User talk:Werdnae

724 bytes added, 22:08, 4 April 2014
Template parser help
== Template parser help ==
Hi Werd. In the [[Template:TrettaInfobox|Tretta Infobox]], there is a switch that defines what category an article will belong to based on a numeric parameter. Due to the number naming conventions, I now need seprate outcomes for "1" and "01". The switch will always output whichever is first since it doesn't take leading zeros into account. Is there a way around this? Thanks. {{unsigned|Nuva-kal}}
:I think I've fixed it. Not an especially ideal solution, but I've made it pad out the right hand side of the outcomes to (at least) two characters long, using "a" as the padding character. (i.e. 1 is now 1a while 01 remains 01). Hopefully that should prevent them being numerically identical, without creating future issues. If you do need to use 1a, etc. in there in future, you can just change the padding character (in both the padright and the relevant outcomes) to something else which doesn't interfere. <span class="sc">[[User:Werdnae|<span style="color:#2D4B98;">Werdnae</span>]]</span> <small>[[User talk:Werdnae|<span style="color:#009000;">(talk)</span>]]</small> 22:08, 4 April 2014 (UTC)