Template:Val: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>SkyLined
New version - complete rewrite
meta>SkyLined
added arg "e" check
Line 21: Line 21:
           -->{{#if:{{#ifexpr: {{{3|0}}}}}|<!-- Is arg3 not a valid number?
           -->{{#if:{{#ifexpr: {{{3|0}}}}}|<!-- Is arg3 not a valid number?
             -->{{FormattingError|Error in {{tl|val}}: third argument is not a valid number.}}<!--
             -->{{FormattingError|Error in {{tl|val}}: third argument is not a valid number.}}<!--
           -->|<!-- Is arg2 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.}}<!--
               -->{{FormattingError|Error in {{tl|val}}: third argument is not negative.}}<!--
             -->|<!-- Is arg3 positive? NO
             -->|<!-- Is arg3 positive? NO
              -->{{#if:{{#ifexpr: {{{3|0}}}}}|<!-- Is arg "e" not a valid number?
                -->{{FormattingError|Error in {{tl|val}}: exponent is not a valid number.}}<!--
              -->|<!-- Is arg "e" not a valid number? NO
END ERROR CHECKING, START OUTPUT
END ERROR CHECKING, START OUTPUT
                  -->{{delimitnum|{{{1|}}}}}<!-- Output arg1, formatted.
                -->{{delimitnum|{{{1|}}}}}<!-- Output arg1, formatted.
              -->{{#if: {{{2|}}}|<!-- Are there 2 or more arguments?
                -->{{#if: {{{2|}}}|<!-- Are there 2 or more arguments?
                -->&nbsp;<!--
                  -->&nbsp;<!--
                -->{{#if: {{{3|}}}|<!-- Are there 3 arguments?
                  -->{{#if: {{{3|}}}|<!-- Are there 3 arguments?
                  -->{{su|w=f|<!-- Uncertainty = +X -Y (3 arguments)
                    -->{{su|w=f|<!-- Uncertainty = +X -Y (3 arguments)
                    -->p=+{{delimitnum|{{{2}}}}}|<!-- Output +arg2, formatted.
                      -->p=+{{delimitnum|{{{2}}}}}|<!-- Output +arg2, formatted.
                    -->b=&minus;{{delimitnum|{{#expr:-{{{3}}}}}}}<!-- Output -arg3, formatted.
                      -->b=&minus;{{delimitnum|{{#expr:-{{{3}}}}}}}<!-- Output -arg3, formatted.
                  -->}}<!--
                    -->}}<!--
                -->|<!-- 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
                    -->&plusmn;&nbsp;{{delimitnum|{{{2}}}}}<!-- Uncertainty = ±X
                      -->&plusmn;&nbsp;{{delimitnum|{{{2}}}}}<!-- 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|}}}|&nbsp;×&nbsp;10{{su|p={{delimitnum|{{{e}}}}}}}</sup>}}<!-- e=exponent
                -->{{#if: {{{e|}}}|&nbsp;×&nbsp;10{{su|p={{delimitnum|{{{e}}}}}}}</sup>}}<!-- e=exponent
              -->{{#if: {{{u|}}}|&nbsp;{{ScientificValue/units|{{{u}}}}}}}<!-- u=units
                -->{{#if: {{{u|}}}|&nbsp;{{ScientificValue/units|{{{u}}}}}}}<!-- u=units
              -->}}<!-- End Is arg "e" not a valid number?
             -->}}<!-- End Is arg3 positive?
             -->}}<!-- End Is arg3 positive?
           -->}}<!-- End Is arg3 not a valid number?
           -->}}<!-- End Is arg3 not a valid number?

Revision as of 10:12, 14 April 2008