Modèle:Val/Documentation
This template is used to easily present values in scientific notation, including uncertainty and/or units, as prescribed by Wikipedia's Manual of Style.
Utilisation
[modifier le code]Val specializes in numeric values, especially those with scientific notations, uncertainty notations, and those with measurement values with physical units. Because these expressions are covered by the Manual of Style, Val provides the stylized output for you, and keeps them from wrapping across lines.
Express a numeral:
{{val|123456.78901}}
→ value, formated with gaps: 123 456,789 01, or with|fmt=commas
→ 1 234,567 890 1.{{val|number|number}}
→ value ± uncertainty, like 123 478 ± 56{{val|number|number|number}}
→value (su) like 1 234+56
−78
Express a measurement value: {{val|4|u=m2}}
→ 4 m2. The m2 is a "unit code" that Val uses to lookup the link to the unit's article, and the formatting of the unit symbol.
Sometimes a number and unit code is not enough. A prefix or suffix are also available, |p=
and |s=
.
{{val|7600|u=C⋅Ga|p=>|s=<}}
→ >7 600 C⋅Ga<{{val|7600|u=C|p=<span style="color:green"><sup>|s=</sup></span>}}
→ 7 600 C
Arguments
[modifier le code]Val takes three unnamed parameters. The first is always the numeric value. When the second and third are numbers they become the various uncertainty notations, but the second unnamed parameter can also serve to grammatically join the first and third numbers.
Val clears surrounding spaces in its unnamed parameters.
'1 |
A number in decimal point notation or in e notation. The main basis of the Val expression. Defaults to 10
|
'2 |
Uncertainty in either format.
|
'3 |
Asymmetric uncertainty.
|
|u= |
Val adds a space and the unit.
|
|p= |
Prefix the entire Val expression. Non-spaced, but accepts markup.
|
|s= |
Suffix the entire Val expression. Non-spaced, but accepts markup.
|
|e=
|
Exponential. Val also accepts e notation.
|
More example expressions
[modifier le code]- Number
{{val|1234567.1234567}}
→ 1 234 567,123 456 7
.{{val| 1234567.1234567 }}.
→ .
1 234 567,123 456 7.
{{val|-1234567}}
→ −1 234 567
- Uncertainty
{{val|1.234|0.005}}
→ 1,234 ± 0,005
{{val|1.234|+0.005|-0.006}}
→ 1,234+0,005
−0,006
{{val|1.234|(5)}}
→ 1,234 ± (5)
- Units
{{val|1.234|u=m}}
→ 1,234 m
{{val|1.234|u=m2}}
→ 1,234 m2
{{val|12.34|u=deg}}
→ 12,34 deg
{{val|1.234|0.005|u='}}
→ 1,234 ± 0,005 '
{{val|1.234|+0.005|-0.006|u="}}
→ 1,234+0,005
−0,006 "
{{val|1.234|u=%}}
→ 1,234 %
- Exponents
{{val|1.234e7|0.056}}
→ (1,234 ± 0,056) × 107
{{val|1.234|0.056|e=7}}
→ (1,234 ± 0,056) × 107
{{val|1.234e-2|(5)}}
→ (1,234 ± (5)) × 10−2
{{val|1.234|(5)|e=-2}}
→ (1,234 ± (5)) × 10−2
- Prefix/suffix
{{val|12.34|p=Δ }}
→ Δ 12,34
{{val|12.34|u=%|p=≅}}
→ ≅12,34 %
{{val|12.34|0.25|s=%}}
→ 12,34 ± 0,25%