Template:Val/doc: Difference between revisions

[checked revision][checked revision]
Content deleted Content added
Created page with "{{Documentation subpage}} {{High-use}} {{COinS safe|n}} {{Lua|Module:Val}} {{Commons Import}} This template is used to easily present values in scientific notation, inclu..."
 
m Text replacement - "[[WP:" to "[[Wikipedia:WP:"
 
Line 5:
{{Commons Import}}
 
This template is used to easily present values in [[scientific notation]], including uncertainty and/or units, as prescribed by Wikipedia's [[Wikipedia:WP:MOSNUM|Manual of Style]].
 
== Introduction ==
Line 21:
There are a large number of unit codes that Val understands and keeps "up to code". A unit code is the just abbreviated unit name, but these can get quite involved for a compound or composite unit, with "multipliers" or "dividers". See [[Module:Val/units]].
 
Some unit-code flexibility is provided by having four parameters to work the unit-code system: whether to link one or not, (see ''[[Wikipedia:WP:Overlinking|Overlinking]]''), and whether to link the numerator or denominator of a unit ratio separately.
* <code>&#123;{val|''number''|'''ul='''''unit code''}}</code> &rarr; ''number {{font color|blue|symbol}}'', such as {{val|9.8|ul=km2}}
* <code>&#123;{val|''number''|'''u='''''unit code''}}</code> &rarr; ''number&nbsp;symbol'', such as {{val|9.8|u=km2}}
Line 136:
== Format of numbers ==
 
{{tl|Val}} produces formatting compliant with Wikipedia's [[Wikipedia:WP:MOSNUM|Manual of Style]].
 
The [[Wikipedia:MOSNUM#Delimiting (grouping of digits)|MOS]] recommends that numbers either be delimited using thin spaces either side of the decimal, or commas to the left and no delimiters to the right. Articles should be consistent with respect to the style of delimiting. The template defaults to the former style, this can be adjusted using <code>|fmt=</code> (see [[#Arguments|above]]).
Line 289:
; Q. How should I use Val?
: A1. Val probably already has your unit on [[Module:Val/units|its current list]]. If not, add your own unit there.
: A2. To avoid [[Wikipedia:WP:OVERLINKING|overlinking]], switch from {{para|ul}} to {{para|u}} and from {{para|upl}} to {{para|up}}.
: A3. Any time you have a unit to link or a table to sort, Val already setup with that unit's link and sorting value.
: A3. Use Val along with {{tl|Convert}}. See [[Module:Convert/data|how to add units to Convert]].