Template:Val: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>WOSlinker
(remove {{pp-template}} since included in {{documentation}})
meta>Verdy p
m (some chars saved in parameter space (memory). Balanced (left-right) thin-space margins on operators. Needs more in /doc)
Line 1: Line 1:
<noinclude>
<includeonly><!--
{{documentation}}
<!--
 
PLEASE ADD CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS
Normally, the code for the template is included, but this template is too complex to do that.
--></noinclude><includeonly><!--
--><span style="white-space:nowrap"><!--
--><span style="white-space:nowrap"><!--
START ERROR CHECKING:
START ERROR CHECKING:
Line 17: Line 11:
       -->{{FormattingError|Error in {{tl|val}}: third argument is not a valid number or requires too much precision to display.|nocategory={{{nocategory|}}}}}<!--
       -->{{FormattingError|Error in {{tl|val}}: third argument is not a valid number or requires too much precision to display.|nocategory={{{nocategory|}}}}}<!--
     -->|<!-- Is arg3 not a valid number? NO
     -->|<!-- Is arg3 not a valid number? NO
       -->{{#ifexpr: {{{3|-1}}} >= 0|<!-- Is arg3 positive?
       -->{{#ifexpr:({{{3|-1}}})>=0|<!-- Is arg3 positive?
         -->{{FormattingError|Error in {{tl|val}}: third argument is not negative.|nocategory={{{nocategory|}}}}}<!--
         -->{{FormattingError|Error in {{tl|val}}: third argument is not negative.|nocategory={{{nocategory|}}}}}<!--
       -->|<!-- Is arg3 positive? NO
       -->|<!-- Is arg3 positive? NO
Line 34: Line 28:
END ERROR CHECKING, START OUTPUT
END ERROR CHECKING, START OUTPUT
                 -->{{{p|}}}<!-- If p (prefix) is defined, display it.
                 -->{{{p|}}}<!-- If p (prefix) is defined, display it.
 
                 -->{{#if:{{{1|}}}|<!-- Are there any arguments?
                 -->{{#if: {{{1|}}}|<!-- Are there any arguments?
                   -->{{val/delimitnum|{{{1|}}}}}{{{end|}}}<!-- Output arg1, formatted.
                   -->{{val/delimitnum|{{{1|}}}}}{{{end|}}}<!-- Output arg1, formatted.
                   -->{{#if: {{{2|}}}|<!-- Are there 2 or more arguments?
                   -->{{#if:{{{2|}}}|<!-- Are there 2 or more arguments?
                     -->{{#if: {{{3|}}}|<!-- Are there 3 arguments?
                     -->{{#if:{{{3|}}}|<!-- Are there 3 arguments?
                       --><span style="white-space:nowrap;margin-left:0.3em;">{{su|<!-- Uncertainty = +X -Y (3 arguments)
                       --><span style="white-space:nowrap;margin-left:.15em">{{su|<!-- Uncertainty = +X -Y (3 arguments)
                         -->w=f|a=r|<!-- Fixed width, right aligned
                         -->w=f|a=r|<!-- Fixed width, right aligned
                         -->p=+{{val/delimitnum|{{{2}}}}}{{{+errend|}}}|<!-- Output +arg2, formatted.
                         -->p=+{{val/delimitnum|{{{2}}}}}{{{+errend|}}}|<!-- Output +arg2, formatted.
Line 45: Line 38:
                       -->}}</span><!--
                       -->}}</span><!--
                     -->|<!-- Are there 3 arguments? NO
                     -->|<!-- Are there 3 arguments? NO
                       -->{{#if:{{#ifexpr: 0{{{2}}}}}|<!-- Second argument is "(number)"?
                       -->{{#if:{{#ifexpr:0{{{2}}}}}|<!-- Second argument is "(number)"?
                         -->{{{2}}}<!-- Significance = (X)
                         -->{{{2}}}<!-- Significance = (X)
                       -->|<!-- Second argument is "(number)"? NO
                       -->|<!-- Second argument is "(number)"? NO
                         --><span style="white-space:nowrap;margin-left:0.3em;margin-right:0.15em">±</span>{{val/delimitnum|{{{2}}}}}{{{errend|}}}<!-- Uncertainty = ±X
                         --><span style="white-space:nowrap;margin-left:.15em;margin-right:.15em">±</span>{{val/delimitnum|{{{2}}}}}{{{errend|}}}<!-- Uncertainty = ±X
                       -->}}<!-- End second argument is "(number)"?
                       -->}}<!-- End second argument is "(number)"?
                     -->}}<!-- End Are there 3 arguments?
                     -->}}<!-- End Are there 3 arguments?
                   -->}}<!-- End Are there 2 arguments?
                   -->}}<!-- End Are there 2 arguments?
                   -->{{#if:{{{e|}}}|<span style="white-space:nowrap;margin-left:0.25em;margin-right:0.15em">×</span>10{{su|p={{val/delimitnum|{{{e}}}}}}}}}<!-- e=exponent
                   -->{{#if:{{{e|}}}|<span style="white-space:nowrap;margin-left:.15em;margin-right:.15em">×</span>10{{su|p={{val/delimitnum|{{{e}}}}}}}}}<!-- e=exponent
                 -->|<!-- Are there any arguments? NO
                 -->|<!-- Are there any arguments? NO
                   -->{{#if:{{{e|}}}|10{{su|p={{val/delimitnum|{{{e}}}}}}}}}<!-- e=exponent
                   -->{{#if:{{{e|}}}|10{{su|p={{val/delimitnum|{{{e}}}}}}}}}<!-- e=exponent
Line 69: Line 62:
   -->}}<!-- End Is arg2 not a valid number?
   -->}}<!-- End Is arg2 not a valid number?
-->}}<!-- End Is arg1 not a valid number?
-->}}<!-- End Is arg1 not a valid number?
--></span></includeonly>
--></span></includeonly><noinclude>{{documentation}}<!--
PLEASE ADD CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS
Normally, the code for the template is included, but this template is too complex to do that.
--></noinclude>

Revision as of 17:49, 8 October 2010