Template:Val: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>SkyLined
Removed parenthesis, changed layout using comments
meta>SkyLined
New version - complete rewrite
Line 6: Line 6:
--></noinclude><includeonly><!--
--></noinclude><includeonly><!--
--><span style="white-space:nowrap"><!--
--><span style="white-space:nowrap"><!--
   -->{{#if: {{{n|}}}|{{delimitnum|{{{n}}}}}}}<!--"n" Value
START ERROR CHECKING:
  -->{{{1|}}}<!--First argument value
   -->{{#if: {{{n|}}}|<!-- Is there an argument "n"?
  -->{{#if:{{{s|}}}|&nbsp;({{{s}}})}}<!--Significance
    -->{{FormattingError|Error in {{tl|val}}: argument "n" is deprecated.}}<!--
  -->{{#if: {{{2|}}}|&nbsp;{{#if: {{{3|}}}|<!-- 2 or 3 arguments?
  -->|<!-- Is there an argument "n"? NO
    -->{{su|w=f|p={{{2}}}|b={{{3}}}}}<!--Uncertainty (3 arguments)
    -->{{#if: {{{s|}}}|<!-- Is there an argument "s"?
    -->|±&nbsp;{{{2}}}<!--Uncertainty (2 arguments)
      -->{{FormattingError|Error in {{tl|val}}: argument "s" is deprecated.}}<!--
  -->}}}}<!--
    -->|<!-- Is there an argument "s"? NO
  -->{{#if: {{{e|}}}|&nbsp;×&nbsp;10<sup>{{{e}}}</sup>}}<!--
      -->{{#if:{{#ifexpr: {{{1}}}}}|<!-- Is arg1 not a valid number?
  -->{{#if: {{{u|}}}|&nbsp;{{ScientificValue/units|{{{u}}}}}}}<!--
        -->{{FormattingError|Error in {{tl|val}}: first argument is not a valid number.}}<!--
      -->|<!-- Is arg1 not a valid number? NO
        -->{{#if:{{#ifexpr: {{{2|0}}}}}|<!-- Is arg2 not a valid number?
          -->{{FormattingError|Error in {{tl|val}}: second argument is not a valid number.}}<!--
        -->|<!-- Is arg2 not a valid number? NO
          -->{{#if:{{#ifexpr: {{{3|0}}}}}|<!-- Is arg3 not a valid number?
            -->{{FormattingError|Error in {{tl|val}}: third argument is not a valid number.}}<!--
          -->|<!-- Is arg2 not a valid number? NO
            -->{{#ifexpr: {{{3|-1}}} >= 0|<!-- Is arg3 positive?
              -->{{FormattingError|Error in {{tl|val}}: third argument is not negative.}}<!--
            -->|<!-- Is arg3 positive? NO
END ERROR CHECKING, START OUTPUT
                  -->{{delimitnum|{{{1|}}}}}<!-- Output arg1, formatted.
              -->{{#if: {{{2|}}}|<!-- Are there 2 or more arguments?
                -->&nbsp;<!--
                -->{{#if: {{{3|}}}|<!-- Are there 3 arguments?
                  -->{{su|w=f|<!-- Uncertainty = +X -Y (3 arguments)
                    -->p=+{{delimitnum|{{{2}}}}}|<!-- Output +arg2, formatted.
                    -->b=&minus;{{delimitnum|{{#expr:-{{{3}}}}}}}<!-- Output -arg3, formatted.
                  -->}}<!--
                -->|<!-- Are there 3 arguments? NO
                  -->{{#if:{{#ifexpr: 0{{{2}}}}}|<!-- Second argument is "(number)"?
                    -->{{{2}}}<!-- Significance = (X)
                  -->|<!-- Second argument is "(number)"? NO
                    -->&plusmn;&nbsp;{{delimitnum|{{{2}}}}}<!-- Uncertainty = ±X
                  -->}}<!-- End second argument is "(number)"?
                -->}}<!-- End Are there 3 arguments?
              -->}}<!-- End Are there 2 arguments?
              -->{{#if: {{{e|}}}|&nbsp;×&nbsp;10{{su|p={{delimitnum|{{{e}}}}}}}</sup>}}<!-- e=exponent
              -->{{#if: {{{u|}}}|&nbsp;{{ScientificValue/units|{{{u}}}}}}}<!-- u=units
            -->}}<!-- 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 there an argument "s"?
  -->}}<!-- End Is there an argument "n"?
--></span><!--
--></span><!--
--></includeonly>
--></includeonly>

Revision as of 09:49, 14 April 2008