Template:Val/doc: Difference between revisions
From Zoophilia Wiki
Jump to navigationJump to search
meta>SkyLined →Purpose: Updated |
meta>SkyLined →Arguments: Updated |
||
Line 6: | Line 6: | ||
== Arguments == | == Arguments == | ||
: | There are three variations of this template: | ||
* {{tl|val}} for displaying values without uncertainty/significance. | |||
* {{tl|val±}} for displaying values with uncertainty like so {{val/±|1234|56}}. | |||
* {{tl|val+-}} for displaying values with uncertainty like so {{val/+-|1234|+56|-78}} | |||
* {{tl|val()}} for displaying values with significance like so {{val/()|1234|56}} | |||
:'''1''' The value | They all take roughly the same arguments | ||
:'''1''' The value (or nothing if you use the "n" argument) | |||
or | :'''2''' The (upper limit of) uncertainty or significance | ||
:'''2''' The upper limit of uncertainty | :'''3''' The lower limit of uncertainty (must be a negative value, only used with {{tl|val±}}) | ||
:'''3''' The lower limit of uncertainty (must be a negative value) | You can use the following optional named arguments: | ||
:'''n''' The value as a number to be formatted using {{tl|delimitnum}} (Argument '''1'''must be empty when using this, eg. <code><nowiki>{{</nowiki>val||n=...|...}}</code>) | |||
:'''n''' The value as a number to be formatted using {{tl|delimitnum}} ( | :'''e''' The exponent for the power of 10. | ||
:'''e''' The exponent for power of 10. | |||
:'''u''' The units for the number. | :'''u''' The units for the number. | ||
Units are replaced by a more esthetically pleasing HTML representation and get a link, if they are in the list found in {{tl|ScientificValue/units}} or if they are supported by {{tl|convert}}. A good example is "m/s", which gets translated to "[[Meter per second|m·s<sup>-1</sup>]]". | Units are replaced by a more esthetically pleasing HTML representation and get a link, if they are in the list found in {{tl|ScientificValue/units}} or if they are supported by {{tl|convert}}. A good example is "m/s", which gets translated to "[[Meter per second|m·s<sup>-1</sup>]]". |
Revision as of 20:37, 9 April 2008
Template:Template doc page viewed directly
Purpose
Set of templates that can be used to easily present values in scientific notation, including uncertainty. They have the same look and feel and wrap the entire result in a"nowrap" block, so it never gets broken in seperate pieces at the end of a line.
Arguments
There are three variations of this template:
- {{val}} for displaying values without uncertainty/significance.
- {{val±}} for displaying values with uncertainty like so Template:Val/±.
- {{val+-}} for displaying values with uncertainty like so Template:Val/+-
- {{val()}} for displaying values with significance like so Template:Val/()
They all take roughly the same arguments
- 1 The value (or nothing if you use the "n" argument)
- 2 The (upper limit of) uncertainty or significance
- 3 The lower limit of uncertainty (must be a negative value, only used with {{val±}})
You can use the following optional named arguments:
- n The value as a number to be formatted using {{delimitnum}} (Argument 1must be empty when using this, eg.
{{val||n=...|...}}
) - e The exponent for the power of 10.
- u The units for the number.
Units are replaced by a more esthetically pleasing HTML representation and get a link, if they are in the list found in {{ScientificValue/units}} or if they are supported by {{convert}}. A good example is "m/s", which gets translated to "m·s-1".
Examples
{{ScientificValue|1.234}}
→ Template:ScientificValue Uncertainty/significance {{ScientificValue|1.234|0.005}}
→ Template:ScientificValue {{ScientificValue|1.234|+0.005|-0.001}}
→ Template:ScientificValue {{ScientificValue|1.234|s=5}}
→ Template:ScientificValue Exponents/units {{ScientificValue|1.234|e=10|u=m}}
→ Template:ScientificValue {{ScientificValue|1.234|0.05|e=5}}
→ Template:ScientificValue {{ScientificValue|1.234|+0.05|-0.04|e=-23|u=m/s}}
→ Template:ScientificValue {{ScientificValue|1.234|0.04|e=3|u=psi}}
→ Template:ScientificValue {{ScientificValue|123.4|u=USgal}}
→ Template:ScientificValue {{ScientificValue|12.34|u=mpgimp}}
→ Template:ScientificValue Using {{delimitnum}} {{ScientificValue||n=123456789.0123456789}}
→ Template:ScientificValue