Template:Val: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>SkyLined
(<nobr> is not supported ??)
m (233 revisions imported)
 
(136 intermediate revisions by 27 users not shown)
Line 1: Line 1:
<noinclude>
<includeonly>{{{{{♥|safesubst:}}}#invoke:val|main}}</includeonly><noinclude>
{{documentation}}
{{documentation}}
<!--
</noinclude>
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"><!--
START ERROR CHECKING:
-->{{#ifeq:{{valid|number={{{1}}}}}|false|<!-- Is arg1 not a valid number?
  -->{{FormattingError|Error in {{tl|val}}: first argument is not a valid number or requires too much precision to display.}}<!--
-->|<!-- Is arg1 not a valid number? NO
  -->{{#ifeq:{{valid|number={{{2|0}}}}}|false|<!-- Is arg2 not a valid number?
    -->{{FormattingError|Error in {{tl|val}}: second argument is not a valid number or requires too much precision to display.}}<!--
  -->|<!-- Is arg2 not a valid number? NO
    -->{{#ifeq:{{valid|number={{{3|0}}}}}|false|<!-- Is arg3 not a valid number?
      -->{{FormattingError|Error in {{tl|val}}: third argument is not a valid number or requires too much precision to display.}}<!--
    -->|<!-- Is arg3 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
        -->{{#ifeq:{{valid|number={{{e|0}}}}}|false|<!-- Is arg "e" not a valid number?
          -->{{FormattingError|Error in {{tl|val}}: exponent (e) is not a valid number or requires too much precision to display.}}<!--
        -->|<!-- Is arg "e" not a valid number? NO
          -->{{#ifeq:{{{u|{{{up|}}}}}}|{{{up}}}|<!-- Is arg "up" specified but not arg "u"?
            -->{{FormattingError|Error in {{tl|val}}: unit (u) is not specified but units per (up) is.}}<!--
          -->|<!-- Is arg "up" specified but not arg "u"? NO
END ERROR CHECKING, START OUTPUT
            -->{{{h|}}}<!-- h=Header
            -->{{val/delimitnum|{{{1|}}}}}<!-- Output arg1, formatted.
            -->{{#if: {{{2|}}}|<!-- Are there 2 or more arguments?
              -->{{#if: {{{3|}}}|<!-- Are there 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.
                  -->b={{val/delimitnum|{{{3}}}}}<!-- Output -arg3, formatted.
                -->}}</span><!--
              -->|<!-- Are there 3 arguments? NO
                -->{{#if:{{#ifexpr: 0{{{2}}}}}|<!-- Second argument is "(number)"?
                  --><span style="white-space:nowrap;margin-left:0.3em;">{{{2}}}</span><!-- Significance = (X)
                -->|<!-- Second argument is "(number)"? NO
                  --><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 Are there 3 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:{{{u|}}}|&nbsp;{{val/units|{{{u}}}}}}}<!-- u=units
            -->{{#if:{{{up|}}}|/{{val/units|{{{up}}}}}}}<!-- up=per units
            -->{{{f|}}}<!-- f=Footer
          -->}}<!-- End Is arg "up" specified but not arg "u"?
        -->}}<!-- End Is arg "e" not a valid number?
      -->}}<!-- 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?
--></span><!--
--></includeonly>

Latest revision as of 14:07, 3 September 2020