Template:Val: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>SkyLined
Allow use without any unnamed arguments, per talk page request.
meta>SkyLined
Fix bug in previous edit
Line 8: Line 8:
--><span style="white-space:nowrap"><!--
--><span style="white-space:nowrap"><!--
START ERROR CHECKING:
START ERROR CHECKING:
-->{{#ifeq:{{valid|number={{{1|0}}}}}|false|<!-- If there is an unnamed argument, it must be a valid number
-->{{#ifeq:{{valid|number={{{1|0}}} }}|false|<!-- If there is an unnamed argument, it must be a valid number
   -->{{FormattingError|Error in {{tl|val}}: first argument is not a valid number or requires too much precision to display.|nocategory={{{nocategory|}}}}}<!--
   -->{{FormattingError|Error in {{tl|val}}: first argument is not a valid number or requires too much precision to display.|nocategory={{{nocategory|}}}}}<!--
-->|<!-- Is arg1 not a valid number? NO
-->|<!-- Is arg1 not a valid number? NO
Line 52: Line 52:
                     -->}}<!-- 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><!-- e=exponent, output "×"
                   -->{{#if:{{{e|}}}|<span style="white-space:nowrap;margin-left:0.25em;margin-right:0.15em">×</span>}}<!-- e=exponent, output "×"


                 --> End is there at least one unnamed argument
                 --> End is there at least one unnamed argument


                 -->{{#if:{{{e|}}}|10{{su|p={{val/delimitnum|{{{e}}}}}}}}}<!-- e=exponent, output "10^e"
                 -->{{#if:{{{e|}}} |10{{su |p={{val/delimitnum|{{{e}}}}}}}}}<!-- e=exponent, output "10^e"
                 -->{{#if:{{{u|}}}|&nbsp;{{val/units|{{{u}}}}}}}<!-- u=units  
                 -->{{#if:{{{u|}}}|&nbsp;{{val/units|{{{u}}}}}}}<!-- u=units  
                 -->{{#if:{{{ul|}}}|&nbsp;{{val/unitswithlink|{{{ul}}}}}}}<!-- u=units with link
                 -->{{#if:{{{ul|}}}|&nbsp;{{val/unitswithlink|{{{ul}}}}}}}<!-- u=units with link

Revision as of 09:52, 21 December 2009