Template:Val: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>SkyLined
<nobr> is not supported ??
meta>SkyLined
m Added ul and upl argument and error checks
Line 25: Line 25:
             -->{{FormattingError|Error in {{tl|val}}: unit (u) is not specified but units per (up) is.}}<!--
             -->{{FormattingError|Error in {{tl|val}}: unit (u) is not specified but units per (up) is.}}<!--
           -->|<!-- Is arg "up" specified but not arg "u"? NO
           -->|<!-- Is arg "up" specified but not arg "u"? NO
            -->{{#ifeq:{{{u}}}{{{ul}}}|{{{u|}}}{{{ul|}}}|<!-- Is arg "u" and "ul" specified?
              -->{{FormattingError|Error in {{tl|val}}: unit (u) and units with link (ul) are both specified, only one is allowed.}}<!--
            -->|<!-- Is arg "u" and "ul" specified? NO
              -->{{#ifeq:{{{up}}}{{{upl}}}|{{{up|}}}{{{upl|}}}|<!-- Is arg "u" and "ul" specified?
                -->{{FormattingError|Error in {{tl|val}}: unit per (up) and units per with link (upl) are both specified, only one is allowed.}}<!--
              -->|<!-- Is arg "up" and "upl" specified? NO
END ERROR CHECKING, START OUTPUT
END ERROR CHECKING, START OUTPUT
            -->{{{h|}}}<!-- h=Header
                -->{{{h|}}}<!-- h=Header
            -->{{val/delimitnum|{{{1|}}}}}<!-- Output arg1, formatted.
                -->{{val/delimitnum|{{{1|}}}}}<!-- 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|w=f|<!-- Uncertainty = +X -Y (3 arguments)
                    --><span style="white-space:nowrap;margin-left:0.3em;">{{su|w=f|<!-- Uncertainty = +X -Y (3 arguments)
                  -->p=+{{val/delimitnum|{{{2}}}}}|<!-- Output +arg2, formatted.
                      -->p=+{{val/delimitnum|{{{2}}}}}|<!-- Output +arg2, formatted.
                  -->b={{val/delimitnum|{{{3}}}}}<!-- Output -arg3, formatted.
                      -->b={{val/delimitnum|{{{3}}}}}<!-- Output -arg3, formatted.
                -->}}</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)"?
                  --><span style="white-space:nowrap;margin-left:0.3em;">{{{2}}}</span><!-- Significance = (X)
                      --><span style="white-space:nowrap;margin-left:0.3em;">{{{2}}}</span><!-- 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}}}}}<!-- Uncertainty = ±X
                      --><span style="white-space:nowrap;margin-left:0.3em;margin-right:0.15em">±</span>{{val/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|}}}|<span style="white-space:nowrap;margin-left:0.3em;margin-right:0.15em">×</span>10{{su|p={{val/delimitnum|{{{e}}}}}}}}}<!-- e=exponent
                -->{{#if:{{{e|}}}|<span style="white-space:nowrap;margin-left:0.3em;margin-right:0.15em">×</span>10{{su|p={{val/delimitnum|{{{e}}}}}}}}}<!-- e=exponent
            -->{{#if:{{{u|}}}|&nbsp;{{val/units|{{{u}}}}}}}<!-- u=units  
                -->{{#if:{{{u|}}}|&nbsp;{{val/units|{{{u}}}}}}}<!-- u=units  
            -->{{#if:{{{up|}}}|/{{val/units|{{{up}}}}}}}<!-- up=per units  
                -->{{#if:{{{ul|}}}|&nbsp;{{val/unitswithlink|{{{ul}}}}}}}<!-- u=units with link
            -->{{{f|}}}<!-- f=Footer
                -->{{#if:{{{up|}}}|/{{val/units|{{{up}}}}}}}<!-- up=per units  
                -->{{#if:{{{upl|}}}|/{{val/unitswithlink|{{{upl}}}}}}}<!-- up=per units with link
                -->{{{f|}}}<!-- f=Footer
              -->|<!-- 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 "up" specified but not arg "u"?
         -->}}<!-- End Is arg "e" not a valid number?
         -->}}<!-- End Is arg "e" not a valid number?

Revision as of 19:37, 22 April 2008