Difference between revisions of "Template:Epi/moft"

From blackwiki
Jump to navigation Jump to search
imported>Jimp
(Use abbreviations for all units. See Template talk:Epi#Abbreviations.)
imported>Buaidh
(-->{{rnd|{{{1}}}|{{{e|{{{d|0}}}}}}}}<!--)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{#if:{{{1|}}}|{{!}}align={{{a|center}}}{{!}}{{#ifeq:{{{1}}}|#|{{{s|}}}{{{p|}}}{{nk|0|sea level}}|{{nk|{{{1}}}|{{{s|}}}{{#iferror:{{#expr:{{{1}}}+0}}|{{{p|}}}{{{1}}}|{{#ifexpr:{{{1}}}<0|<span style="color:red">}}{{{p|}}}{{formatnum:{{rnd|{{{1}}}|{{{d|0}}}}}|{{#ifexpr:{{{1}}}>900|{{#ifexpr:{{{1}}}<9000|R}}}}}}&nbsp;m{{#ifeq:{{{l|2}}}|1|&#32;(|<br/>}}{{{p|}}}{{rnd|{{{1}}}/0.3048|{{{d|0}}}}}&nbsp;ft{{#ifeq:{{{l|2}}}|1|)}}{{#ifexpr:{{{1}}}<0|</span>}}}}}}{{{s|}}}}}}}<noinclude>
+
{{#if:{{{1|}}}<!--
 +
  -->|{{!}}rowspan={{{r|1}}} align={{{a|center}}}{{!}}<!--
 +
          -->{{#ifeq:{{{1}}}|#<!--
 +
                  -->|{{ntsh|0}}{{{s|}}}{{{p|}}}sea level{{{s|}}}<!--
 +
                  -->|{{#iferror:{{#expr:{{{1}}}+0}}<!--
 +
                    -->|{{ntsh|0}}<!--
 +
                    -->|{{ntsh|{{{1}}}}}<!--
 +
                  -->}}{{{s|}}}<!--
 +
                        -->{{#iferror:{{#expr:{{{1}}}+0}}<!--
 +
                                  -->|{{{p|}}}{{{1}}}<!--
 +
                                  -->|{{#ifexpr:{{{1}}}<0|<span style="color:red">}}<!--
 +
                                          -->{{{p|}}}{{formatnum:<!--
 +
                                                            -->{{rnd|{{{1}}}|{{{e|{{{d|0}}}}}}}}<!--
 +
                                                            -->|{{#ifexpr:{{{1}}}>900<!--
 +
                                                                      -->|{{#ifexpr:{{{1}}}<9000|R}}<!--
 +
                                                                      -->}}<!--
 +
                                                            -->}}&nbsp;m<!--
 +
                                          -->{{#ifeq:{{{l|2}}}|1|&#32;(|<br/>}}<!--
 +
                                          -->{{{p|}}}{{rnd|{{{1}}}/0.3048|{{{d|0}}}}}&nbsp;ft<!--
 +
                                          -->{{#ifeq:{{{l|2}}}|1|)}}<!--
 +
                                    -->{{#ifexpr:{{{1}}}<0|</span>}}<!--
 +
                        -->}}<!--
 +
                    -->{{{s|}}}<!--
 +
                  -->}}<!--
 +
  -->}}<!--
 +
--><noinclude>
 
{{Documentation}}
 
{{Documentation}}
 
</noinclude>
 
</noinclude>

Latest revision as of 17:39, 28 September 2015

Template documentation[view] [edit] [history] [purge]

Use

This subtemplate is used by {{Epi}}. It creates one sortable cell of a sortable table displaying a measurement formatted in meters followed with the same measurement formatted in international feet (of exactly 0.3048 meters).

The syntax of this template is:

{{moft|var1|a=|d=|e=|l=|p=|r=|s=}}

where:

  • var1 is a real number representing the measurement in meters (may not contain a thousands separator), # for sea level, or NA if not available.
  • a is an optional alignment parameter:
    • a=left yields left alignment
    • a=center yields center alignment (default)
    • a=right yields right alignment
  • d is an optional integer representing the number of decimal places of feet to display (default=0)
  • e is an optional integer representing the number of decimal places of meters to display (default=0)
  • l is an optional lines parameter:
    • l=1 yields a single-line display
    • l=2 yields a double-line display (default)
  • p is an optional prefix to display before each number, e.g. about , ~, >, < (default is no prefix)
  • r is an optional integer representing the number of rows to span (default=1)
  • s is an optional style parameter:
    • s= yields regular style (default)
    • s='' yields italic style
    • s=''' yields bold style
    • s=''''' yields bold italic style

See also