Template:Val: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>Cpiral
(New START UNITS section)
meta>Cpiral
(←noninclude> all comments)
Line 1: Line 1:
<includeonly><!--
<includeonly><noinclude><!--
--><span class="nowrap"><!--
--></noinclude><span class="digits nowrap"><noinclude><!--
START ERROR CHECKING:
START ERROR CHECKING:
                 -->{{#iferror:{{#expr:{{{1|0}}}}}<!-- Is arg1 not a valid number?
                 --></noinclude>{{#iferror:{{#expr:{{{1|0}}}}}<noinclude><!-- Is arg1 not a valid number?
  arg1 isn't valid -->|{{FormattingError|Error in {{tl|val}}: first argument is not a valid number.|nocategory={{{nocategory|}}}}}<!--
  arg1 isn't valid --></noinclude>|{{FormattingError|Error in {{tl|val}}: first argument is not a valid number.|nocategory={{{nocategory|}}}}}<noinclude><!--
  arg1 is    valid -->|{{#iferror:{{#expr:{{{2|0}}}}}<!-- Is arg2 not a valid number?
  arg1 is    valid --></noinclude>|{{#iferror:{{#expr:{{{2|0}}}}}<noinclude><!-- Is arg2 not a valid number?
     arg2 isn't valid -->|{{FormattingError|Error in {{tl|val}}: second argument is not a valid number.|nocategory={{{nocategory|}}}}}<!--
     arg2 isn't valid --></noinclude>|{{FormattingError|Error in {{tl|val}}: second argument is not a valid number.|nocategory={{{nocategory|}}}}}<noinclude><!--
     arg2 is    valid -->|{{#iferror:{{#expr:{{{3|0}}}}}<!-- Is arg3 not a valid number?
     arg2 is    valid --></noinclude>|{{#iferror:{{#expr:{{{3|0}}}}}<noinclude><!-- Is arg3 not a valid number?
         arg3 isn't valid -->|{{FormattingError|Error in {{tl|val}}: third argument is not a valid number.|nocategory={{{nocategory|}}}}}<!--
         arg3 isn't valid --></noinclude>|{{FormattingError|Error in {{tl|val}}: third argument is not a valid number.|nocategory={{{nocategory|}}}}}<noinclude><!--
         arg3 is    valid -->|{{#ifexpr: {{{2|0}}} < 0<!-- Is arg2 negative?
         arg3 is    valid --></noinclude>|{{#ifexpr: {{{2|0}}} < 0<noinclude><!-- Is arg2 negative?
           arg2 is negative -->|{{FormattingError|Error in {{tl|val}}: second argument is negative.|nocategory={{{nocategory|}}}}}<!--
           arg2 is negative --></noinclude>|{{FormattingError|Error in {{tl|val}}: second argument is negative.|nocategory={{{nocategory|}}}}}<noinclude><!--
           arg2 is positive -->|{{#iferror:{{#expr:{{{e|0}}}}}<!-- Is arg "e" not a valid number?
           arg2 is positive --></noinclude>|{{#iferror:{{#expr:{{{e|0}}}}}<noinclude><!-- Is arg "e" not a valid number?
               "e"  isn't valid -->|{{FormattingError|Error in {{tl|val}}: exponent ('''e''') is not a valid number.|nocategory={{{nocategory|}}}}}<!--
               "e"  isn't valid --></noinclude>|{{FormattingError|Error in {{tl|val}}: exponent ('''e''') is not a valid number.|nocategory={{{nocategory|}}}}}<noinclude><!--
               "e"  is    valid -->|{{#ifeq:{{{u}}}{{{ul}}}|{{{u|}}}{{{ul|}}}<!-- Is arg "u" and "ul" specified?
               "e"  is    valid --></noinclude>|{{#ifeq:{{{u}}}{{{ul}}}|{{{u|}}}{{{ul|}}}<noinclude><!-- Is arg "u" and "ul" specified?
   "u"  & "ul"      both specified -->|{{FormattingError|Error in {{tl|val}}: unit ('''u''') and units with link ('''ul''') are both specified, only one is allowed.|nocategory={{{nocategory|}}}}}<!--
   "u"  & "ul"      both specified --></noinclude>|{{FormattingError|Error in {{tl|val}}: unit ('''u''') and units with link ('''ul''') are both specified, only one is allowed.|nocategory={{{nocategory|}}}}}<noinclude><!--
   "u"  & "ul"  not both specified -->|{{#ifeq:{{{up}}}{{{upl}}}|{{{up|}}}{{{upl|}}}<!-- Is arg "up" and "upl" specified?
   "u"  & "ul"  not both specified --></noinclude>|{{#ifeq:{{{up}}}{{{upl}}}|{{{up|}}}{{{upl|}}}<noinclude><!-- Is arg "up" and "upl" specified?
     "up" & "ulp"    both specified -->|{{FormattingError|Error in {{tl|val}}: unit per ('''up''') and units per with link ('''upl''') are both specified, only one is allowed.|nocategory={{{nocategory|}}}}}<!--
     "up" & "ulp"    both specified --></noinclude>|{{FormattingError|Error in {{tl|val}}: unit per ('''up''') and units per with link ('''upl''') are both specified, only one is allowed.|nocategory={{{nocategory|}}}}}<noinclude><!--
     "up" & "ulp" not both specified -->|<!--
     "up" & "ulp" not both specified --></noinclude>|<noinclude><!--
END OPENING OF ERROR CHECKING, START OUTPUT
END OPENING OF ERROR CHECKING, START OUTPUT


START HIDDEN SORT KEY
START HIDDEN SORT KEY
-->{{#ifeq:{{{sortable}}}|off||{{val/sortkey|{{{sortval|{{{1|1}}}}}}|e={{{e|0}}}|u={{{us|{{{u|{{{ul|}}}}}}}}}|up={{{ups|{{{up|{{{upl|}}}}}}}}}|ls={{{long scale}}}}}}}<!--        hidden sort key based on the SI base unit(s)
--></noinclude>{{#ifeq:{{{sortable}}}|off||{{val/sortkey|{{{sortval|{{{1|1}}}}}}|e={{{e|0}}}|u={{{us|{{{u|{{{ul|}}}}}}}}}|up={{{ups|{{{up|{{{upl|}}}}}}}}}|ls={{{long scale}}}}}}}<noinclude><!--        hidden sort key based on the SI base unit(s)
END HIDDEN SORT KEY
END HIDDEN SORT KEY


START PREFIX
START PREFIX
-->{{{p|}}}<!-- If p (prefix) is defined, display it.
--></noinclude>{{{p|}}}<noinclude><!-- If p (prefix) is defined, display it.
END PREFIX
END PREFIX


START NUMERICAL OUTPUT
START NUMERICAL OUTPUT
<!--  numerical output            -->{{#if:{{{1|}}}<!--                                                    Are there any arguments?
<noinclude><!--  numerical output            --></noinclude>{{#if:{{{1|}}}<noinclude><!--                                                    Are there any arguments?
There are arguments.                -->|{{#if:{{{2|}}}<!--                                                    Are there 2 or more arguments?
There are arguments.                --></noinclude>|{{#if:{{{2|}}}<noinclude><!--                                                    Are there 2 or more arguments?
   There are 2 or more arguments.      -->|{{#if:{{{3|}}}<!--                                                    Are there 3 arguments?
   There are 2 or more arguments.      --></noinclude>|{{#if:{{{3|}}}<noinclude><!--                                                    Are there 3 arguments?
       There are 3 arguments.              -->|{{val/delimitnum|fmt={{{fmt|gaps}}}|{{{1|}}}|u={{{u|{{{ul}}}}}}}}<!--  Output arg1, formatted.
       There are 3 arguments.              --></noinclude>|{{val/delimitnum|fmt={{{fmt|gaps}}}|{{{1|}}}|u={{{u|{{{ul}}}}}}}}<noinclude><!--  Output arg1, formatted.
                                             -->{{{end|}}}{{val/angle|{{{u}}}|{{{ul}}}}}<!--                          Append something and/or add angle/percent symbol.  
                                             --></noinclude>{{{end|}}}{{val/angle|{{{u}}}|{{{ul}}}}}<noinclude><!--                          Append something and/or add angle/percent symbol.  
               Uncertainty = +X/-Y          -->{{val/+-<!--                                                          Add + & - errors.
               Uncertainty = +X/-Y          --></noinclude>{{val/+-<noinclude><!--                                                          Add + & - errors.
                                               -->|w={{{w|}}}|a={{{a|r}}}<!--                                            Option fixed width, default right aligned
                                               --></noinclude>|w={{{w|}}}|a={{{a|r}}}<noinclude><!--                                            Option fixed width, default right aligned
                                               -->|{{val/delimitnum|fmt={{{fmt|gaps}}}|{{{2}}}|nosign=on}}<!--          Output +arg2, formatted.
                                               --></noinclude>|{{val/delimitnum|fmt={{{fmt|gaps}}}|{{{2}}}|nosign=on}}<noinclude><!--          Output +arg2, formatted.
                                                 -->{{{+errend|}}}{{val/angle|{{{u|{{{ul}}}}}}}}<!--                      Append something and/or add angle/percent symbol.
                                                 --></noinclude>{{{+errend|}}}{{val/angle|{{{u|{{{ul}}}}}}}}<noinclude><!--                      Append something and/or add angle/percent symbol.
                                               -->|{{val/delimitnum|fmt={{{fmt|gaps}}}|{{{3}}}|nosign=on}}<!--        Output -arg3, formatted.
                                               --></noinclude>|{{val/delimitnum|fmt={{{fmt|gaps}}}|{{{3}}}|nosign=on}}<noinclude><!--        Output -arg3, formatted.
                                                 -->{{{-errend|}}}{{val/angle|{{{u|{{{ul}}}}}}}}<!--                  Append something and/or add angle/percent symbol.
                                                 --></noinclude>{{{-errend|}}}{{val/angle|{{{u|{{{ul}}}}}}}}<noinclude><!--                  Append something and/or add angle/percent symbol.
                                             -->}}<!--                                                              End are there 3 arguments (Uncertainty = +X/-Y)
                                             --></noinclude>}}<noinclude><!--                                                              End are there 3 arguments (Uncertainty = +X/-Y)
                                             -->{{#if:{{{e|}}}<!--                                                  Is there an exponent?
                                             --></noinclude>{{#if:{{{e|}}}<noinclude><!--                                                  Is there an exponent?
               There is an exponent.          -->|<span style="margin-left:0.25em;margin-right:0.15em">×</span>10<sup>{{val/delimitnum|fmt={{{fmt|gaps}}}|{{{e}}}}}</sup><!-- × 10^e
               There is an exponent.          --></noinclude>|<span style="margin-left:0.25em;margin-right:0.15em">×</span>10<sup>{{val/delimitnum|fmt={{{fmt|gaps}}}|{{{e}}}}}</sup><noinclude><!-- × 10^e
                                             -->}}<!--                                                              End is there an exponent
                                             --></noinclude>}}<noinclude><!--                                                              End is there an exponent
       There are there not three arguments. -->|{{#iferror:{{#expr:0{{{2}}}}}<!--                                  Is second argument "(number)"?     
       There are there not three arguments. --></noinclude>|{{#iferror:{{#expr:0{{{2}}}}}<noinclude><!--                                  Is second argument "(number)"?     
             Second argument is "(number)".    -->|{{val/delimitnum|fmt={{{fmt|gaps}}}|{{{1|}}}|u={{{u|{{{ul}}}}}}}}<!--  Output arg1, formatted.
             Second argument is "(number)".    --></noinclude>|{{val/delimitnum|fmt={{{fmt|gaps}}}|{{{1|}}}|u={{{u|{{{ul}}}}}}}}<noinclude><!--  Output arg1, formatted.
                                               -->{{{end|}}}{{{2}}}<!--                                              Uncertainty (X)  
                                               --></noinclude>{{{end|}}}{{{2}}}<noinclude><!--                                              Uncertainty (X)  
                                               -->{{val/angle|{{{u}}}|{{{ul}}}}}<!--                                  Add angle/percent symbol.
                                               --></noinclude>{{val/angle|{{{u}}}|{{{ul}}}}}<noinclude><!--                                  Add angle/percent symbol.
                                               -->{{#if:{{{e|}}}<!--                                              Is there an exponent?
                                               --></noinclude>{{#if:{{{e|}}}<noinclude><!--                                              Is there an exponent?
                                                 -->|<span style="margin-left:0.25em;margin-right:0.15em">×</span>10<sup>{{val/delimitnum|fmt={{{fmt|gaps}}}|{{{e}}}}}</sup><!-- × 10^e
                                                 --></noinclude>|<span style="margin-left:0.25em;margin-right:0.15em">×</span>10<sup>{{val/delimitnum|fmt={{{fmt|gaps}}}|{{{e}}}}}</sup><noinclude><!-- × 10^e
                                               -->}}<!--                                                          End is there an exponent
                                               --></noinclude>}}<noinclude><!--                                                          End is there an exponent
             Second argument is not "(number)".-->|{{#if:{{{e|}}}<!--                                                  Is there an exponent?
             Second argument is not "(number)".--></noinclude>|{{#if:{{{e|}}}<noinclude><!--                                                  Is there an exponent?
               There is an exponent.              -->|({{val/delimitnum|fmt={{{fmt|gaps}}}|{{{1|}}}|u={{{u|{{{ul}}}}}}}}<!--  Output arg1, formatted.
               There is an exponent.              --></noinclude>|({{val/delimitnum|fmt={{{fmt|gaps}}}|{{{1|}}}|u={{{u|{{{ul}}}}}}}}<noinclude><!--  Output arg1, formatted.
                                                   -->{{{end|}}}{{val/angle|{{{u}}}|{{{ul}}}}}<!--                    Append something and/or add angle/percent symbol.
                                                   --></noinclude>{{{end|}}}{{val/angle|{{{u}}}|{{{ul}}}}}<noinclude><!--                    Append something and/or add angle/percent symbol.
                 Uncertainty = ±X                -->{{val/±<!--                                                      Add ± symbol.
                 Uncertainty = ±X                --></noinclude>{{val/±<noinclude><!--                                                      Add ± symbol.
                                                     -->|{{val/delimitnum|fmt={{{fmt|gaps}}}|{{{2}}}}}<!--              Format number.
                                                     --></noinclude>|{{val/delimitnum|fmt={{{fmt|gaps}}}|{{{2}}}}}<noinclude><!--              Format number.
                                                       -->{{{errend|}}}{{val/angle|{{{u|{{{ul}}}}}}}}<!--                Append something and/or add angle/percent symbol.
                                                       --></noinclude>{{{errend|}}}{{val/angle|{{{u|{{{ul}}}}}}}}<noinclude><!--                Append something and/or add angle/percent symbol.
                                                   -->}})<!--                                                          End Uncertainty = ±X
                                                   --></noinclude>}})<noinclude><!--                                                          End Uncertainty = ±X
                                                   --><span style="margin-left:0.25em;margin-right:0.15em">×</span>10<sup>{{val/delimitnum|fmt={{{fmt|gaps}}}|{{{e}}}}}</sup><!-- × 10^e
                                                   --></noinclude><span style="margin-left:0.25em;margin-right:0.15em">×</span>10<sup>{{val/delimitnum|fmt={{{fmt|gaps}}}|{{{e}}}}}</sup><noinclude><!-- × 10^e
               There is no exponent.              -->|{{val/delimitnum|fmt={{{fmt|gaps}}}|{{{1|}}}|u={{{u|{{{ul}}}}}}}}<!--  Output arg1, formatted.
               There is no exponent.              --></noinclude>|{{val/delimitnum|fmt={{{fmt|gaps}}}|{{{1|}}}|u={{{u|{{{ul}}}}}}}}<noinclude><!--  Output arg1, formatted.
                                                   -->{{{end|}}}{{val/angle|{{{u}}}|{{{ul}}}}}<!--                        Append something and/or add angle/percent symbol.
                                                   --></noinclude>{{{end|}}}{{val/angle|{{{u}}}|{{{ul}}}}}<noinclude><!--                        Append something and/or add angle/percent symbol.
                   Uncertainty = ±X                -->{{val/±<!--                                                        Add ± symbol.
                   Uncertainty = ±X                --></noinclude>{{val/±<noinclude><!--                                                        Add ± symbol.
                                                     -->|{{val/delimitnum|fmt={{{fmt|gaps}}}|{{{2}}}}}<!--                  Format number.
                                                     --></noinclude>|{{val/delimitnum|fmt={{{fmt|gaps}}}|{{{2}}}}}<noinclude><!--                  Format number.
                                                       -->{{{errend|}}}{{val/angle|{{{u|{{{ul}}}}}}}}<!--                    Append something and/or add angle/percent symbol.
                                                       --></noinclude>{{{errend|}}}{{val/angle|{{{u|{{{ul}}}}}}}}<noinclude><!--                    Append something and/or add angle/percent symbol.
                                                   -->}}<!--                                                              End Uncertainty = ±X
                                                   --></noinclude>}}<noinclude><!--                                                              End Uncertainty = ±X
                                               -->}}<!--                                                              End is there and exponent.
                                               --></noinclude>}}<noinclude><!--                                                              End is there and exponent.
                                             -->}}<!--                                                              End second argument is "(number)"?
                                             --></noinclude>}}<noinclude><!--                                                              End second argument is "(number)"?
                                         -->}}<!--                                                              End Are there 3 arguments?
                                         --></noinclude>}}<noinclude><!--                                                              End Are there 3 arguments?
   2 arguments? No                      -->|{{val/delimitnum|fmt={{{fmt|gaps}}}|{{{1|}}}|u={{{u|{{{ul}}}}}}}}<!--  Output arg1, formatted.
   2 arguments? No                      --></noinclude>|{{val/delimitnum|fmt={{{fmt|gaps}}}|{{{1|}}}|u={{{u|{{{ul}}}}}}}}<noinclude><!--  Output arg1, formatted.
                                         -->{{{end|}}}{{val/angle|{{{u}}}|{{{ul}}}}}<!--                        Append something and/or add angle/percent symbol.
                                         --></noinclude>{{{end|}}}{{val/angle|{{{u}}}|{{{ul}}}}}<noinclude><!--                        Append something and/or add angle/percent symbol.
                                         -->{{#if:{{{e|}}}<!--                                                  Is there an exponent?
                                         --></noinclude>{{#if:{{{e|}}}<noinclude><!--                                                  Is there an exponent?
       There is an exponent.                -->|<span style="margin-left:0.25em;margin-right:0.15em">×</span>10<sup>{{val/delimitnum|fmt={{{fmt|gaps}}}|{{{e}}}}}</sup><!-- × 10^e
       There is an exponent.                --></noinclude>|<span style="margin-left:0.25em;margin-right:0.15em">×</span>10<sup>{{val/delimitnum|fmt={{{fmt|gaps}}}|{{{e}}}}}</sup><noinclude><!-- × 10^e
                                         -->}}<!--                                                              End is there an exponent
                                         --></noinclude>}}<noinclude><!--                                                              End is there an exponent
                                       -->}}<!--                                                              End Are there 2 or more arguments?
                                       --></noinclude>}}<noinclude><!--                                                              End Are there 2 or more arguments?
There are no arguments.              -->|10<sup>{{val/delimitnum|fmt={{{fmt|gaps}}}|{{{e|0}}}}}</sup><!-- Output 10^e only.
There are no arguments.              --></noinclude>|10<sup>{{val/delimitnum|fmt={{{fmt|gaps}}}|{{{e|0}}}}}</sup><noinclude><!-- Output 10^e only.
                                   -->}}<!--                                                              End Are there any arguments?
                                   --></noinclude>}}<noinclude><!--                                                              End Are there any arguments?
END NUMERICAL OUTPUT
END NUMERICAL OUTPUT


START UNITS
START UNITS
-->{{#if:{{{up|}}}{{{upl|}}}   
--></noinclude>{{#if:{{{up|}}}{{{upl|}}}   
   |
   |
   {{#if:{{{u|}}}
   {{#if:{{{u|}}}
Line 87: Line 87:
         |source =  
         |source =  
           {{#invoke:String|replace
           {{#invoke:String|replace
           <!--&nbsp;[[title|markup]]: & (or [) is 1st, [ is 7th (or 1st)-->
           <noinclude><!--&nbsp;[[title|markup]]: & (or [) is 1st, [ is 7th (or 1st)--></noinclude>
             |source = {{Val/units/sandbox|{{{u}}}}}
             |source = {{Val/units/sandbox|{{{u}}}}}
             |pattern = %[%[.+{{!}} <!--keeps &nbsp;, but compare others -->
             |pattern = %[%[.+{{!}} <noinclude><!--keeps &nbsp;, but compare others --></noinclude>
             |replace = (
             |replace = (
             |plain = false
             |plain = false
Line 96: Line 96:
         |replace = )  
         |replace = )  
       }}
       }}
       | <!-- Same thing, but without replace with parentheses -->
       | <noinclude><!-- Same thing, but without replace with parentheses --></noinclude>
       {{#invoke:String|replace
       {{#invoke:String|replace
         |source =  
         |source =  
Line 109: Line 109:
       }}
       }}
     }}
     }}
   }}<!-- end up/upl AND u
   }}<noinclude><!-- end up/upl AND u
-->{{#if:{{{ul|}}}  <!-- With up/upl its possible to have neither u nor ul.-->
--></noinclude>{{#if:{{{ul|}}}  <noinclude><!-- With up/upl its possible to have neither u nor ul.--></noinclude>
   |
   |
     {{#ifexpr:{{#invoke:String|find|source={{{ul}}}|target=[./*]|plain=false}}
     {{#ifexpr:{{#invoke:String|find|source={{{ul}}}|target=[./*]|plain=false}}
       | <!-- Grouping parentheses -->
       | <noinclude><!-- Grouping parentheses --></noinclude>
         {{#invoke:String|replace
         {{#invoke:String|replace
           |source =  
           |source =  
           {{#invoke:String|replace
           {{#invoke:String|replace
             |source = {{Val/units/sandbox|{{{ul}}}|ls={{{long scale}}}}}
             |source = {{Val/units/sandbox|{{{ul}}}|ls={{{long scale}}}}}
             |pattern = [ <!-- keep spacing -->
             |pattern = [ <noinclude><!-- keep spacing --></noinclude>
             |replace = ([
             |replace = ([
             |count = 1
             |count = 1
Line 124: Line 124:
           |pattern = %]%]
           |pattern = %]%]
           |replace = ]])
           |replace = ]])
           |plain = false <!-- using %]%], not ]], prevents code mangle -->
           |plain = false <noinclude><!-- using %]%], not ]], prevents code mangle --></noinclude>
         }}
         }}
       | <!-- normal call -->
       | <noinclude><!-- normal call --></noinclude>
       {{val/units/sandbox|{{{ul}}}|ls = {{{long scale}}}}}
       {{val/units/sandbox|{{{ul}}}|ls = {{{long scale}}}}}
     }}
     }}
   }}<!-- End up/upl AND ul
   }}<noinclude><!-- End up/upl AND ul
-->{{#if:{{{up|}}}
--></noinclude>{{#if:{{{up|}}}
     |
     |
     {{#ifexpr:{{#invoke:String|find|source={{{up}}}|target=[./*]|plain=false}}
     {{#ifexpr:{{#invoke:String|find|source={{{up}}}|target=[./*]|plain=false}}
Line 138: Line 138:
           {{#invoke:String|replace
           {{#invoke:String|replace
             |source = {{Val/units/sandbox|{{{up}}}}}
             |source = {{Val/units/sandbox|{{{up}}}}}
             |pattern = .*%[%[.+{{!}} <!-- remove spacing -->
             |pattern = .*%[%[.+{{!}} <noinclude><!-- remove spacing --></noinclude>
             |replace = /(
             |replace = /(
             |plain = false
             |plain = false
Line 145: Line 145:
         |replace = )  
         |replace = )  
       }}
       }}
       | <!-- Same thing, but without replace with parentheses -->
       | <noinclude><!-- Same thing, but without replace with parentheses --></noinclude>
       {{#invoke:String|replace
       {{#invoke:String|replace
         |source =  
         |source =  
Line 158: Line 158:
       }}
       }}
     }}
     }}
   | <!-- upl -->
   | <noinclude><!-- upl --></noinclude>
     {{#ifexpr:{{#invoke:String|find|source={{{upl}}}|target=[./*]|plain=false}}
     {{#ifexpr:{{#invoke:String|find|source={{{upl}}}|target=[./*]|plain=false}}
       |
       |
Line 165: Line 165:
           {{#invoke:String|replace
           {{#invoke:String|replace
             |source = {{Val/units/sandbox|{{{upl}}}}}
             |source = {{Val/units/sandbox|{{{upl}}}}}
             |pattern = .-%[ <!-- remove spacing -->
             |pattern = .-%[ <noinclude><!-- remove spacing --></noinclude>
             |replace = /([
             |replace = /([
             |plain = false
             |plain = false
Line 174: Line 174:
         |plain = false
         |plain = false
       }}
       }}
       | <!-- Same thing, but without replace with parentheses -->
       | <noinclude><!-- Same thing, but without replace with parentheses --></noinclude>
       {{#invoke:String|replace
       {{#invoke:String|replace
         |source = {{val/units/sandbox|{{{upl}}}}}
         |source = {{val/units/sandbox|{{{upl}}}}}
         |pattern = .-%[ <!-- remove spacing: PCRE is .*?[ -->
         |pattern = .-%[ <noinclude><!-- remove spacing: PCRE is .*?[ --></noinclude>
         |replace = /[
         |replace = /[
         |plain = false
         |plain = false
Line 184: Line 184:
     }}
     }}
   }}
   }}
  | <!-- No up/upl -->
  | <noinclude><!-- No up/upl --></noinclude>
   {{#if:{{{u|}}}
   {{#if:{{{u|}}}
     |
     |
Line 191: Line 191:
           {{#invoke:String|replace
           {{#invoke:String|replace
             |source = {{val/units/sandbox|{{{u}}}}}
             |source = {{val/units/sandbox|{{{u}}}}}
             |pattern = %[%[.+{{!}} <!-- keep unit spacing -->
             |pattern = %[%[.+{{!}} <noinclude><!-- keep unit spacing --></noinclude>
             |replace =  
             |replace =  
             |plain = false
             |plain = false
Line 198: Line 198:
         |replace =
         |replace =
       }}
       }}
   }}<!--
   }}<noinclude><!--
   -->{{#if:{{{ul|}}}
   --></noinclude>{{#if:{{{ul|}}}
     |{{val/units/sandbox|{{{ul}}}|ls = {{{long scale}}}}}
     |{{val/units/sandbox|{{{ul}}}|ls = {{{long scale}}}}}
   }}
   }}
  }}<!-- end up/upl
  }}<noinclude><!-- end up/upl
END UNITS
END UNITS


START SUFFIX
START SUFFIX
-->{{{s|}}}<!-- If s (suffix) is defined, display it.
--></noinclude>{{{s|}}}<noinclude><!-- If s (suffix) is defined, display it.
END PREFIX
END PREFIX


START CLOSING OF ERROR CHECKING
START CLOSING OF ERROR CHECKING
                   -->}}<!-- End Is arg "up" and "upl" specified?
                   --></noinclude>}}<noinclude><!-- End Is arg "up" and "upl" specified?
               -->}}<!-- End Is arg "u" and "ul" specified?
               --></noinclude>}}<noinclude><!-- End Is arg "u" and "ul" specified?
             -->}}<!-- End Is arg "e" not a valid number?
             --></noinclude>}}<noinclude><!-- End Is arg "e" not a valid number?
         -->}}<!-- End Is arg2 negative?
         --></noinclude>}}<noinclude><!-- End Is arg2 negative?
       -->}}<!-- End Is arg3 not a valid number?
       --></noinclude>}}<noinclude><!-- End Is arg3 not a valid number?
   -->}}<!-- End Is arg2 not a valid number?
   --></noinclude>}}<noinclude><!-- End Is arg2 not a valid number?
-->}}<!-- End Is arg1 not a valid number?
--></noinclude>}}<noinclude><!-- End Is arg1 not a valid number?
END ERROR CHECKING
END ERROR CHECKING
--></span></includeonly><noinclude>
--></noinclude></span></includeonly><noinclude>
{{documentation}}
{{documentation}}
</noinclude>
</noinclude>

Revision as of 16:58, 2 June 2015