Template:Val/doc: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>Jimp
→‎Examples: formatting
meta>Jimp
→‎Examples: more examples
Line 37: Line 37:
|-
|-
|<code><nowiki>{{ScientificValue|1.234|0.04|e=3|u=psi}}</nowiki></code>||&nbsp;→&nbsp;||{{ScientificValue|1.234|0.04|e=3|u=psi}}
|<code><nowiki>{{ScientificValue|1.234|0.04|e=3|u=psi}}</nowiki></code>||&nbsp;→&nbsp;||{{ScientificValue|1.234|0.04|e=3|u=psi}}
|-
|<code><nowiki>{{ScientificValue|123.4|u=USgal}}</nowiki></code>||&nbsp;→&nbsp;||{{ScientificValue|123.4|u=USgal}}
|-
|<code><nowiki>{{ScientificValue|12.34|u=mpgimp}}</nowiki></code>||&nbsp;→&nbsp;||{{ScientificValue|12.34|u=mpgimp}}
|}
|}
[[Category:Wikipedia formatting templates|ScientificValue]]
[[Category:Wikipedia formatting templates|ScientificValue]]

Revision as of 00:55, 9 April 2008

Template:Template doc page viewed directly

Purpose

To easily present values in scientific notation, including uncertainty. Wraps entire result in "nowrap" block, so it never gets broken in seperate pieces at the end of a line.

There are two shorter aliases for this template: {{Sci}} and {{Val}}, which can be used if the long name of the main template makes the page you're editing hard to read.

Arguments

1 The value

or

1 The value
2 The uncertainty

or

1 The value
2 The upper limit of uncertainty
3 The lower limit of uncertainty (must be a negative value)

and you can use the following named arguments:

e The exponent for 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
{{ScientificValue|1.234|e=10|u=m}}  →  Template:ScientificValue
{{ScientificValue|1.234|0.005}}  →  Template:ScientificValue
{{ScientificValue|1.234|+0.005|-0.001}}  →  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