Template:Val: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>Laurascudder
m Arguments: grammar
meta>SkyLined
Removed requirement for second argument, added examples, adjusted arguments description
Line 4: Line 4:
== Arguments ==
== Arguments ==
:'''1''' The value
:'''1''' The value
:'''2''' The uncertainty
:'''2''' The uncertainty (optional)
or, if a third argument is specified:
or, if there are three arguments specified:
:'''1''' The value
:'''2''' The upper limit of uncertainty
:'''2''' The upper limit of uncertainty
:'''3''' The lower limit of uncertainty (must be negative)
:'''3''' The lower limit of uncertainty (must be negative)
finally, you can supply an exponent for 10:
finally, you can always supply an exponent a power of 10:
:'''e''' The exponent for ten.
:'''e''' The exponent for power of 10.


== Examples ==
== Examples ==
:<code><nowiki>{{ScientificValue|1.234}}</nowiki></code> -> {{ScientificValue|1.234}}
:<code><nowiki>{{ScientificValue|1.234|e=10}}</nowiki></code> -> {{ScientificValue|1.234|e=10}}
:<code><nowiki>{{ScientificValue|1.234|0.005}}</nowiki></code> -> {{ScientificValue|1.234|0.005}}
:<code><nowiki>{{ScientificValue|1.234|0.005}}</nowiki></code> -> {{ScientificValue|1.234|0.005}}
:<code><nowiki>{{ScientificValue|1.234|+0.005|-0.001}}</nowiki></code> -> {{ScientificValue|1.234|+0.005|-0.001}}
:<code><nowiki>{{ScientificValue|1.234|+0.005|-0.001}}</nowiki></code> -> {{ScientificValue|1.234|+0.005|-0.001}}
Line 17: Line 20:
:<code><nowiki>{{ScientificValue|1.234|+0.05|-0.04|e=-23}}</nowiki></code> -> {{ScientificValue|1.234|+0.05|-0.04|e=-23}}
:<code><nowiki>{{ScientificValue|1.234|+0.05|-0.04|e=-23}}</nowiki></code> -> {{ScientificValue|1.234|+0.05|-0.04|e=-23}}


</noinclude><includeonly>{{{1}}}&nbsp;<code>{{#if: {{{3|}}}
</noinclude><includeonly>{{{1}}}{{#if: {{{2|}}}
|&nbsp;<code>{{#if: {{{3|}}}
|<small><sub>&minus;{{#expr:-{{{3}}}}}</sub></small><sup><small style="margin-left: -{{#expr:1+{{DigitsInNumber|{{{3}}}}}}}ex;">+{{#expr:{{{2}}}}}</small></sup>
|<small><sub>&minus;{{#expr:-{{{3}}}}}</sub></small><sup><small style="margin-left: -{{#expr:1+{{DigitsInNumber|{{{3}}}}}}}ex;">+{{#expr:{{{2}}}}}</small></sup>
|<small>&plusmn;{{#expr:{{{2}}}}}</small>
|<small>&plusmn;{{#expr:{{{2}}}}}</small>
}}</code>{{#if: {{{e|}}}
}}</code>
}}{{#if: {{{e|}}}
|&nbsp;× 10<code><sup><small>{{{e}}}</small></sup></code>
|&nbsp;× 10<code><sup><small>{{{e}}}</small></sup></code>
}}</includeonly>
}}</includeonly>

Revision as of 16:15, 27 March 2008

Template used to present values in a scientific manner, including uncertainty. You can use either {{ScientificValue}} or {{val}} to call this template.

Arguments

1 The value
2 The uncertainty (optional)

or, if there are three arguments specified:

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

finally, you can always supply an exponent a power of 10:

e The exponent for power of 10.

Examples

{{ScientificValue|1.234}} -> Template:ScientificValue
{{ScientificValue|1.234|e=10}} -> 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}} -> Template:ScientificValue