User talk:Pokemaster97: Difference between revisions

From Bulbapedia, the community-driven Pokémon encyclopedia.
Jump to navigationJump to search
m (→‎Template wikicode question: Make Pt more legible against that background color of yours)
m (→‎Template wikicode question: retiring Template:Tl)
Line 314: Line 314:
== Template wikicode question ==
== Template wikicode question ==


I am writing a sandboxed version of the {{tl|alldex}} row template for use on a draft article ([[User:Force Fire/List of Pokémon that appear in multiple regional Pokédex]]) that is currently nominated for mainspacing. I want this sandboxed version to take into account whether a non-numeric input (like <code>---</code> or <code>???</code>) is fed to any of its parameters.
I am writing a sandboxed version of the {{template|alldex}} row template for use on a draft article ([[User:Force Fire/List of Pokémon that appear in multiple regional Pokédex]]) that is currently nominated for mainspacing. I want this sandboxed version to take into account whether a non-numeric input (like <code>---</code> or <code>???</code>) is fed to any of its parameters.


On the current version in templatespace, whenever a non-numeric input is fed to the <code>s=</code> parameter, as in the following example:
On the current version in templatespace, whenever a non-numeric input is fed to the <code>s=</code> parameter, as in the following example:
Line 326: Line 326:
This is because of the following numeric comparison statement being executed by the template to determine whether or not to append <span style="background:white">{{sup/4|Pt}}</span> to the Sdex number:
This is because of the following numeric comparison statement being executed by the template to determine whether or not to append <span style="background:white">{{sup/4|Pt}}</span> to the Sdex number:
<pre>{{#ifexpr: {{{s|001}}} > 151|{{Sup/4|Pt}}}}</pre>
<pre>{{#ifexpr: {{{s|001}}} > 151|{{Sup/4|Pt}}}}</pre>
The comparison <code><nowiki>{{{s|001}}} > 151</nowiki></code> crashes whenever <code>s=</code> is non-numeric. So, I want to modify my sandboxed copy of {{tl|alldex}} to not execute the numeric comparison above unless the input is purely numeric.
The comparison <code><nowiki>{{{s|001}}} > 151</nowiki></code> crashes whenever <code>s=</code> is non-numeric. So, I want to modify my sandboxed copy of {{template|alldex}} to not execute the numeric comparison above unless the input is purely numeric.


I want to ask if there is a wikicode command (like <code><nowiki>{{#ifnum: {{{in|def}}}|out}}</nowiki></code> or similar) that I can use in my template to check whether the input is a number (positive, negative, etc.) and execute the output only upon meeting that numeric constraint. That way, I could have my template do this without crashing or returning error messages:
I want to ask if there is a wikicode command (like <code><nowiki>{{#ifnum: {{{in|def}}}|out}}</nowiki></code> or similar) that I can use in my template to check whether the input is a number (positive, negative, etc.) and execute the output only upon meeting that numeric constraint. That way, I could have my template do this without crashing or returning error messages:

Revision as of 00:56, 6 March 2019

Archive 1 Archive 2 Archive 3 Archive 4


015