Difference between revisions of "Template:CODATA2010-helper"

From blackwiki
Jump to navigation Jump to search
imported>Electrical & computer engineer
(removing support for units-per)
imported>Electrical & computer engineer
(commented out all included newlines)
Line 1: Line 1:
 
<noinclude>This template is necessary because when [[Template:CODATA2010]] calls itself, a template loop is detected, and it fails.
 
<noinclude>This template is necessary because when [[Template:CODATA2010]] calls itself, a template loop is detected, and it fails.
</noinclude>
+
</noinclude><!--
{{#ifeq: {{{debug|no}}} | yes |
+
-->{{#ifeq: {{{debug|no}}}|yes|<!--
 
+
-->CODATA2010-helper parameters:<!--
CODATA2010-helper parameters:
+
-->{&#123;{1}&#125;}={{{1}}}<!--
{&#123;{1}&#125;}={{{1}}}
+
-->{&#123;{2}&#125;}={{{2}}}<!--
{&#123;{2}&#125;}={{{2}}}
+
-->{&#123;{e}&#125;}={{{e}}}<!--
{&#123;{e}&#125;}={{{e}}}
+
-->{&#123;{include-units}&#125;}={{{include-units}}}<!--
{&#123;{include-units}&#125;}={{{include-units}}}
+
-->{&#123;{units}&#125;}={{{units}}}<!--
{&#123;{units}&#125;}={{{units}}}
+
--><br /><!--
<br />
+
-->|}}<!--
|}}
+
-->{{#if: {{{1|}}}  |<!--
{{#if: {{{1|}}}  |
+
    -->{{val<!--
  {{val<!--
+
        -->|{{{1}}}<!--
    -->|{{{1}}}<!--
+
        -->|{{{2|}}}<!--
    -->|{{{2|}}}<!--
+
        -->|e={{{e|}}}<!--
    -->|e={{{e|}}}<!--
+
        -->|{{#ifeq: {{{include-units|link}}}|link|ul|u}}={{#ifeq: {{{include-units|link}}}|no||{{{units|}}}}}<!--
    -->|{{#ifeq: {{{include-units|link}}}|link|ul|u}}={{#ifeq: {{{include-units|link}}}|no||{{{units|}}}}}<!--
+
        -->}}<!--
    -->}}
+
    -->|<!-- number parameter not set
  | <!--number parameter not set-->
+
-->This call of CODATA2010-helper lacks unnamed parameters.<!--
  This call of CODATA2010-helper lacks unnamed parameters.
+
-->}}<!--
}}
+
--><noinclude>
<noinclude>
 
 
{{documentation}}
 
{{documentation}}
 
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS -->
 
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS -->
 
</noinclude>
 
</noinclude>

Revision as of 23:53, 14 June 2011

This template is necessary because when Template:CODATA2010 calls itself, a template loop is detected, and it fails. This call of CODATA2010-helper lacks unnamed parameters.

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

Purpose

To reduce the amount of duplicate code, Template:CODATA2010 uses this template to call Template:val. Template:CODATA2010 receives the name of a physical constant as a parameter, and passes the value of the constant (including uncertainty and units) to this template, along with most of the rest of its parameters.

Parameters

  • 1: The part of the value preceding the uncertainty and multiplication by a power of ten
  • 2 (optional): The uncertainty in the last digits of the value, expressed as one or more digits surrounded by parentheses
  • e (optional): The exponent for the power of ten
  • include-units (optional): no, no link, or default link. Respectively, omits the units (appropriate when the units are given elsewhere in the article), merely includes the units, or includes the units as links to the page about the unit.
  • units (optional): The units for the physical constant
  • debug (optional): If yes, displays a list of the parameters with their values before the main output.

Usage examples

See Template:CODATA2010-helper/testcases#Testing main template

See also

Template:CODATA2010

Template:Val