Template:Val: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>Headbomb
fix angle logic
meta>Jimp
brackets around units when combo units are further combined using a slash (see talk)
Line 17: Line 17:
           -->{{FormattingError|Error in {{tl|val}}: exponent ('''e''') is not a valid number or requires too much precision to display.|nocategory={{{nocategory|}}}}}<!--
           -->{{FormattingError|Error in {{tl|val}}: exponent ('''e''') is not a valid number or requires too much precision to display.|nocategory={{{nocategory|}}}}}<!--
         -->|<!-- Is arg "e" not a valid number? NO
         -->|<!-- Is arg "e" not a valid number? NO
          -->{{#ifeq:{{{u|{{{ul|{{{up|{{{upl|}}}}}}}}}}}}|{{{up|{{{upl}}}}}}|<!-- Is arg "up" or "upl" specified but not arg "u" or "ul"?
            -->{{FormattingError|Error in {{tl|val}}: unit ('''u''' or '''ul''') is not specified but units per ('''up''' or '''upl''') is.|nocategory={{{nocategory|}}}}}<!--
          -->|<!-- Is arg "up" specified but not arg "u"? NO
             -->{{#ifeq:{{{u}}}{{{ul}}}|{{{u|}}}{{{ul|}}}|<!-- Is arg "u" and "ul" specified?
             -->{{#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.|nocategory={{{nocategory|}}}}}<!--
               -->{{FormattingError|Error in {{tl|val}}: unit ('''u''') and units with link ('''ul''') are both specified, only one is allowed.|nocategory={{{nocategory|}}}}}<!--
Line 92: Line 89:


START UNITS
START UNITS
-->{{#if:{{{u|}}}|{{val/units|{{{u}}}|nbsp=1}}}}<!-- u=units
 
-->{{#if:{{{ul|}}}|{{val/unitswithlink|{{{ul}}}|nbsp=1}}}}<!-- u=units with link
-->{{#if:{{{up|}}}{{{upl|}}}<!--
  -->{{#if:{{{up|}}}|/{{val/units|{{{up}}}}}}}<!-- up=per units
 
  -->{{#if:{{{upl|}}}|/{{val/unitswithlink|{{{upl}}}}}}}<!-- up=per units with link
    If there is a up or upl, put brackets around any u or ul with a slash.
    -->{{{s|}}}<!-- If s (suffix) is defined, display it.
 
  -->}}<!-- End Is arg "up" and "upl" specified?
  -->|{{#if:{{{u|}}}|{{val/units|{{{u}}}|nbsp|(|)}}}}<!--
  -->}}<!-- End Is arg "u" and "ul" specified?
  -->{{#if:{{{ul|}}}|{{val/unitswithlink|{{{ul}}}|nbsp|(|)}}}}<!--
-->}}<!-- End Is arg "up" specified but not arg "u"?
 
-->}}<!-- End Is arg "e" not a valid number?
    Add the slash and after it put brackets around any up or upl with a dot or another slash.
 
  -->{{#if:{{{up|}}}<!--
    -->|{{val/units|{{{up}}}|#47|(|)|(|)}}<!--
    -->|{{val/unitswithlink|{{{upl}}}|#47|(|)|(|)}}<!--
  -->}}<!--
 
    No brackets are needed if there is no up or upl, just add the non-breaking space.
 
  -->|{{#if:{{{u|}}}|{{val/units|{{{u}}}|nbsp}}}}<!--
  -->{{#if:{{{ul|}}}|{{val/unitswithlink|{{{ul}}}|nbsp}}}}<!--
-->}}<!--  
-->{{{s|}}}<!-- If s (suffix) is defined, display it.
 


END UNITS
END UNITS


START CLOSING OF ERROR CHECKING
START CLOSING OF ERROR CHECKING
-->}}<!-- End Is arg "up" and "upl" specified?
-->}}<!-- End Is arg "u" and "ul" specified?
-->}}<!-- 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 11:44, 14 February 2014