Template:Val: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>SkyLined
m Undid a failed experiment, rerendering page
meta>SkyLined
Added '''e''' argument, added a space between number and uncertainty, changed font for uncertainty to fixed width
Line 3: Line 3:


== Arguments ==
== Arguments ==
# The value
:'''1''' The value
# The uncertainty
:'''2''' The uncertainty
or
or, if a third argument is specified:
# The value
:'''2''' The upper limit of uncertainty
# The upper limit of uncertainty
:'''3''' The lower limit of uncertainty (must be negative)
# The lower limit of uncertainty (must be negative)
finally, you can supplied an exponent for 10:
:'''e''' The exponent for ten.


== Examples ==
== Examples ==
:<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}}
:<code><nowiki>{{ScientificValue|1.234|0.05|e=5}}</nowiki></code> -> {{ScientificValue|1.234|0.005}}
:<code><nowiki>{{ScientificValue|1.234|+0.05|-0.04|e=-23}}</nowiki></code> -> {{ScientificValue|1.234|+0.005|-0.001}}


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

Revision as of 15:37, 27 March 2008

Template used to present values in a scientific manner, including uncertainty.

Arguments

1 The value
2 The uncertainty

or, if a third argument is specified:

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

finally, you can supplied an exponent for 10:

e The exponent for ten.

Examples

{{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