Difference between revisions of "Template:X10^"

From blackwiki
Jump to navigation Jump to search
(+ hr)
m (55 revisions imported)
 
(51 intermediate revisions by 36 users not shown)
Line 1: Line 1:
×10<sup>{{{1}}}</sup><noinclude>
+
{{#if:{{{1|}}}
[[fr:Modèle:x10]]
+
|<span style="margin:0 .15em 0 .25em">×</span>10<sup><!--
[[hr:Predložak:E]]
+
-->{{#ifeq:{{{2|}}}|text
 +
  |{{{1}}}
 +
  |{{#ifeq:{{valid|number={{{1}}}}}|false
 +
    |{{{1}}}
 +
    |{{#ifeq:{{{2|}}}|plus
 +
      |&#43;{{val/delimitnum|{{{1}}}}}
 +
      |{{val/delimitnum|{{{1}}}}}
 +
    }}
 +
  }}
 +
}}</sup>
 +
|{{Main other|[[Category:Articles using E without any arguments]]}}
 +
}}<noinclude>
 +
{{documentation}}
 
</noinclude>
 
</noinclude>

Latest revision as of 09:38, 30 September 2020

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

The {{10^}} and {{x10^}}templates are intended to facilitate and make uniform scientific notation numbers. The {{10^}} template works exactly as described below except that it does not generate a multiplication (“×”) symbol.

Usage

To render 3.14×1012, instead of writing 3.14&nbsp;&times;&nbsp;10<sup>&minus;12</sup> you can write 3.14{{x10^|-12}}:

{{x10^|b}}×10b

{{10^|b}}10b

{{x10^|-12}}×1012

{{10^|-12}}1012

The first output character for {{x10^}} is a non-breaking thin-space (“]” and “[” are used to illustrate the effects):

]{{x10^|b}}[]×10b[

]{{10^|b}}[]10b[

]{{x10^|-12}}[]×1012[

]{{10^|-12}}[]1012[

Delimiters

The template uses gaps or commas, per {{val/delimitnum}}.
1.2{{x10^|12341}}1.2×1012341

See #Forcing text display to turn this off.

Text and number recognition

By default, the template recognizes both text and numbers. That is, typing 3.14{{x10^|-12}} will produce 3.14×1012, with the proper minus sign (“”), rather than with a hyphen (“-”). However, typing A{{x10^|-BC}} will produce A×10-BC since BC is not a number. In those cases, you need to write A{{x10^|&minus;BC}} to produce the correct A×10−BC.

A minus sign also has to be provided for cases like 1.2×101 − 2 (1.2{{x10^|1 &minus; 2}}).

Explicit plus sign

To explicitly display the + character, write 1.2{{x10^|4|plus}} which will produce 1.2×10+4.

Forcing text display

To force the template to display the input as text, and forgo the automatic delimitation and the recognition of the hyphen as a minus sign, write 1.2{{x10^|&minus;42342|text}}, which will display 1.2×10−42342 instead of 1.2×1042342. This can also be used as an alternative to explicitly display the plus sign (1.2{{x10^|+4|text}} gives 1.2×10+4), but remember that you also lose delimitation if you do it this way.

Tracking category

See also