Difference between revisions of "Template:Infobox IPA/format numbers"

From blackwiki
Jump to navigation Jump to search
imported>DePiep
imported>Primefac
m (Protected "Template:Infobox IPA/format numbers": semi-protection of high-usage templates to combat systematic vandalism ([Edit=Require autoconfirmed or confirmed access] (indefinite) [Move=Require autoconfirmed or confirmed access]...)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{#switch: {{{format type|}}}
 
{{#switch: {{{format type|}}}
 +
 
| format character =<!--
 
| format character =<!--
-->{{#if: {{{a|}}}|&#{{{a|}}};}}{{#if: {{{b|}}}|&#{{{b|}}};}}{{#if: {{{c|}}}|&#{{{c|}}};}}{{#if: {{{d|}}}|&#{{{d|}}};}}
+
-->{{#if: {{{a|}}}|&#{{{a|}}};}}{{#if: {{{b|}}}|&#{{{b|}}};}}<!--
 +
-->{{#if: {{{c|}}}|&#{{{c|}}};}}{{#if: {{{d|}}}|&#{{{d|}}};}}<!--
 +
-->
 
| format check decimals=<!--
 
| format check decimals=<!--
 
-->{{#iferror:{{#expr:0{{{a|}}}}}|{{error|decimal1{{=}}{{{a|}}} is not numeric|tag=span}}<br>|}}<!--
 
-->{{#iferror:{{#expr:0{{{a|}}}}}|{{error|decimal1{{=}}{{{a|}}} is not numeric|tag=span}}<br>|}}<!--
Line 7: Line 10:
 
-->{{#iferror:{{#expr:0{{{c|}}}}}|{{error|decimal3{{=}}{{{c|}}} is not numeric|tag=span}}<br>|}}<!--
 
-->{{#iferror:{{#expr:0{{{c|}}}}}|{{error|decimal3{{=}}{{{c|}}} is not numeric|tag=span}}<br>|}}<!--
 
-->{{#iferror:{{#expr:0{{{d|}}}}}|{{error|decimal4{{=}}{{{d|}}} is not numeric|tag=span}}|}}
 
-->{{#iferror:{{#expr:0{{{d|}}}}}|{{error|decimal4{{=}}{{{d|}}} is not numeric|tag=span}}|}}
<!-- do not use the template {{IPA}} before inputting in IPAsym-->
+
<!-- do not use the template {{IPA}} before inputting in IPAsym
| format html =<!--  
+
-->
-->{{#if: {{{a|}}}|&amp;#{{{a|}}};}}{{#if: {{{b|}}}|{{zwsp}}&amp;#{{{b|}}};}}{{#if: {{{c|}}}|{{zwsp}}&amp;#{{{c|}}};}}{{#if: {{{d|}}}|{{zwsp}}&amp;#{{{d|}}};}}
+
| format html =<!--just string them together with zero width space (&#x200B;)
<!-- Unicode uses &#x2008; (punctuation space). any input {{{unicode|}}} overrules stringing together numbers (this is different from the switch value, 'format type=format unicode') -->
+
-->{{#if: {{{a|}}}|&amp;#{{{a|}}};}}{{#if: {{{b|}}}|&#x200B;&amp;#{{{b|}}};}}{{#if: {{{c|}}}|&#x200B;&amp;#{{{c|}}};}}{{#if: {{{d|}}}|&#x200B;&amp;#{{{d|}}};}}<!--
| format unicode =<!--  
+
-->
-->{{#if: {{{unicode|}}} | {{{unicode|}}} |<!--  
+
<!-- Using &#x2008; (punctuation space) between Unicode codes -->
  -->{{#if: {{{a|}}}|U+{{padleft:{{hexadecimal|{{{a|}}}|no}}|4|0}}}}<!--  
+
| format unicode =<!--just string them together with small space
  -->{{#if: {{{b|}}}|&#x2008;U+{{padleft:{{hexadecimal|{{{b|}}}|no}}|4|0}}}}<!--  
+
-->{{#if: {{{unicode|}}} | {{{unicode|}}} |<!--
  -->{{#if: {{{c|}}}|&#x2008;U+{{padleft:{{hexadecimal|{{{c|}}}|no}}|4|0}}}}<!--  
+
-->{{#if: {{{a|}}}|U+{{padleft:{{hexadecimal|{{{a|}}}|no}}|4|0}}}}<!--
  -->{{#if: {{{d|}}}|&#x2008;U+{{padleft:{{hexadecimal|{{{d|}}}|no}}|4|0}}}}<!--
+
-->{{#if: {{{b|}}}|&#x2008;U+{{padleft:{{hexadecimal|{{{b|}}}|no}}|4|0}}}}<!--
-->}}
+
-->{{#if: {{{c|}}}|&#x2008;U+{{padleft:{{hexadecimal|{{{c|}}}|no}}|4|0}}}}<!--
| #default =<!-- blank-->
+
-->{{#if: {{{d|}}}|&#x2008;U+{{padleft:{{hexadecimal|{{{d|}}}|no}}|4|0}}}}<!--
 +
-->}}<!--
 +
-->
 +
| #default =<!-- blank -->
 
}}<noinclude>
 
}}<noinclude>
 
Formatting from decimal codes.
 
Formatting from decimal codes.
Using named input "a, b, c, d" to prevent spaces sticking with numbers
+
Using named input "a, b, c, d" to prevent spaces in input sticking with numbers
 
</noinclude>
 
</noinclude>

Latest revision as of 00:30, 19 January 2018

Formatting from decimal codes. Using named input "a, b, c, d" to prevent spaces in input sticking with numbers