Template:Val: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>Headbomb
revert to actually stable version
meta>Headbomb
sync with sandbox, code is stable and tested
Line 26: Line 26:
                 -->{{FormattingError|Error in {{tl|val}}: unit per ('''up''') and units per with link ('''upl''') are both specified, only one is allowed.|nocategory={{{nocategory|}}}}}<!--
                 -->{{FormattingError|Error in {{tl|val}}: unit per ('''up''') and units per with link ('''upl''') are both specified, only one is allowed.|nocategory={{{nocategory|}}}}}<!--
               -->|<!-- Is arg "up" and "upl" specified? NO
               -->|<!-- Is arg "up" and "upl" specified? NO
END ERROR CHECKING, START OUTPUT
END OPENING OF ERROR CHECKING, START OUTPUT
 
START OPENING BRACKET
-->{{#if:{{{1|}}}|<!-- Are there any argument?
-->{{#if:{{{2|}}}|<!-- Are there 2 arguments?
  -->{{#if:{{{3|}}}|<!-- Are there 3 arguments?
  -->|<!-- There are 2, but not 3 arguments
    -->{{#if:{{#ifexpr:0{{{2}}}}}|<!-- Second argument is "(number)"? YES, do not check for bracket
                              -->|<!-- Second argument is "(number)"? NO, check for bracket
                              -->{{#if:{{{e|}}}|(<!-- Is there an exponent? YES, open bracket
                              -->}}<!-- End is there an exponent?
    -->}}<!-- End is second argument "(number)"?
  -->}}<!-- end Are there 3 arguments?
-->}}<!-- end Are there 2 arguments?
-->}}<!-- end Are there any arguments?
END OPENING BRACKET
 
START MAIN 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?
Line 41: Line 58:
                         -->{{{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">{{unicode|±}}</span>{{val/delimitnum|fmt={{{fmt|gaps}}}|{{{2}}}}}{{{errend|}}}<!-- Uncertainty = ±X
                         --><span style="white-space:nowrap;margin-left:0.3em;margin-right:0.15em">±</span>{{val/delimitnum|fmt={{{fmt|gaps}}}|{{{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<sup>{{val/delimitnum|fmt={{{fmt|gaps}}}|{{{e}}}}}</sup>}}<!-- e=exponent
                -->}}<!-- End Are there any arguments?
                -->|<!-- Are there any arguments? NO
END MAIN OUTPUT
                  -->{{#if:{{{e|}}}|10<sup>{{val/delimitnum|fmt={{{fmt|gaps}}}|{{{e}}}}}</sup>}}<!-- e=exponent
 
                -->}}<!-- End Are there any arguments?
START CLOSING BRACKET
                -->{{#if:{{{u|}}}|&nbsp;{{val/units|{{{u}}}}}}}<!-- u=units
-->{{#if:{{{1|}}}|<!-- Are there any argument?
                -->{{#if:{{{ul|}}}|&nbsp;{{val/unitswithlink|{{{ul}}}}}}}<!-- u=units with link
-->{{#if:{{{2|}}}|<!-- Are there 2 arguments?
                -->{{#if:{{{up|}}}|/{{val/units|{{{up}}}}}}}<!-- up=per units
  -->{{#if:{{{3|}}}|<!-- Are there 3 arguments?
                -->{{#if:{{{upl|}}}|/{{val/unitswithlink|{{{upl}}}}}}}<!-- up=per units with link
  -->|<!-- There are 2, but not 3 arguments
                -->{{{s|}}}<!-- If s (suffix) is defined, display it.
    -->{{#if:{{#ifexpr:0{{{2}}}}}|<!-- Second argument is "(number)"? YES, do not check for bracket
              -->}}<!-- End Is arg "up" and "upl" specified?
                              -->|<!-- Second argument is "(number)"? NO, check for bracket
            -->}}<!-- End Is arg "u" and "ul" specified?
                              -->{{#if:{{{e|}}}|)<!-- Is there an exponent? YES, close bracket
          -->}}<!-- End Is arg "up" specified but not arg "u"?
                              -->}}<!-- End is there an exponent?
        -->}}<!-- End Is arg "e" not a valid number?
    -->}}<!-- End is second argument "(number)"?
      -->}}<!-- End Is arg3 positive?
  -->}}<!-- end Are there 3 arguments?
    -->}}<!-- End Is arg3 not a valid number?
-->}}<!-- end Are there 2 arguments?
  -->}}<!-- End Is arg2 not a valid number?
-->}}<!-- end Are there any arguments?
END OPENING BRACKET
 
START EXPONENT
-->{{#if:{{{e|}}}<!-- Is there an exponent?
          YES -->|{{#if:{{{1|}}}<!-- Are there any argument?
                        YES -->|<span style="white-space:nowrap;margin-left:0.25em;margin-right:0.15em">×</span>10<sup>{{val/delimitnum|fmt={{{fmt|gaps}}}|{{{e}}}}}</sup><!--
                        NO -->|10<sup>{{val/delimitnum|fmt={{{fmt|gaps}}}|{{{e}}}}}</sup><!--
              -->}}<!-- End are there any argument?<!--
-->}}<!-- End is there an exponent?
END EXPONENT
 
START UNITS
-->{{#if:{{{u|}}}|&nbsp;{{val/units|{{{u}}}}}}}<!-- u=units
-->{{#if:{{{ul|}}}|&nbsp;{{val/unitswithlink|{{{ul}}}}}}}<!-- u=units with link
  -->{{#if:{{{up|}}}|/{{val/units|{{{up}}}}}}}<!-- up=per units
  -->{{#if:{{{upl|}}}|/{{val/unitswithlink|{{{upl}}}}}}}<!-- up=per units with link
    -->{{{s|}}}<!-- If s (suffix) is defined, display it.
  -->}}<!-- End Is arg "up" and "upl" specified?
  -->}}<!-- End Is arg "u" and "ul" specified?
-->}}<!-- End Is arg "up" specified but not arg "u"?
-->}}<!-- End Is arg "e" not a valid number?
 
END UNITS
 
START CLOSING OF ERROR CHECKING
-->}}<!-- End Is arg3 positive?
-->}}<!-- End Is arg3 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?
END ERROR CHECKING
--></span></includeonly><noinclude>
--></span></includeonly><noinclude>
{{documentation}}
{{documentation}}
<!--PLEASE ADD CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS-->
<!--PLEASE ADD CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS-->
</noinclude>
</noinclude>

Revision as of 04:35, 8 February 2014