Dokumentasi cèṭaan[tèngghu] [beccè] [sejarah] [purge]
TemplateStyles' src attribute must not be empty. TemplateStyles' src attribute must not be empty.

Lua error in Modul:Lua_banner at line 113: attempt to index field 'edit' (a nil value).

This template is used to easily present values in scientific notation, including uncertainty and/or units, as prescribed by Wikipedia's Manual of Style.

Introduction

beccè'

Val specializes in numeric values, especially those with scientific notations, uncertainty notations, and those with measurement values with physical units. Because these expressions are covered by the Manual of Style, Val provides the stylized output for you, and keeps them from wrapping across lines.

Express a numeral:

  • {{val|123456.78901}}value, formatted with gaps: Galat skrip: tidak ada modul tersebut "val"., or with |fmt=commasGalat skrip: tidak ada modul tersebut "val".
  • {{val|number|number}}value ± uncertainty, like Galat skrip: tidak ada modul tersebut "val".
  • {{val|number|Cèṭa'an:HilitenumberCèṭa'an:Hilite}}value(uncertainty), like Galat skrip: tidak ada modul tersebut "val".
  • {{val|number|number|number}}value Cèṭa'an:Su like Galat skrip: tidak ada modul tersebut "val".

Express a measurement value: Galat skrip: tidak ada modul tersebut "DemoTemplate".. The m2 is a "unit code" that Val uses to look up the link to the unit's article, and the formatting of the unit symbol. Val links the units to the page it has on file for them. See

  1. REEDIRECT Template:Template link
TemplateStyles' src attribute must not be empty..

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 Overlinking), and whether to link the numerator or denominator of a unit ratio separately.

To bypass the unit code system, if |u= does not recognize your unit code, it will accept any wikitext and render it as usual.

  • Galat skrip: tidak ada modul tersebut "DemoTemplate".
  • Galat skrip: tidak ada modul tersebut "DemoTemplate".

See Module:Val/units for how to add units to the unit code system.

Sometimes a number and unit code is not enough. A prefix or suffix are also available, |p= and |s=.

  • Galat skrip: tidak ada modul tersebut "DemoTemplate".
  • Galat skrip: tidak ada modul tersebut "DemoTemplate".

See

  1. REEDIRECT Template:Template link
TemplateStyles' src attribute must not be empty. to learn the val parameters by an example. It is comprehensive, and there are over 100 examples.

Arguments

beccè'

Val takes three unnamed parameters. The first is always the numeric value. When the second and third are numbers they become the various uncertainty notations, but the second unnamed parameter can also serve to grammatically join the first and third numbers.

Val clears surrounding spaces in its unnamed parameters.

1st or |1= A number. Can be in decimal point notation or in e notation. This number is the basis of the Val formatting.

Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".                    (adds the zero)
Galat skrip: tidak ada modul tersebut "DemoTemplate".                     (displays the plus)
Galat skrip: tidak ada modul tersebut "DemoTemplate".                     (replaces the hyphen-minus with a minus sign)
Galat skrip: tidak ada modul tersebut "DemoTemplate".                (E notation)

|fmt= By default, numbers are formatted with gaps separating groups of three digits in both integer and fractional part.

However, by default, four-digit integers are not formatted; use |fmt=gaps to force gaps.
Use |fmt=commas to delimit the integer part of the number with commas.
Use |fmt=none for no formatting (no gaps or commas).
Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".

|end= Put something at the end of the main number (before anything else that might follow).

Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".

2nd or |2= Uncertainty in either format.

Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".
A conjunction to join two numbers. Useful for ranges, grammatical output, etc.
Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".
Note that for dashes or x's, the various kinds all obtain one properly styled output.

3rd or |3= Asymmetric uncertainty.

Galat skrip: tidak ada modul tersebut "DemoTemplate".

|errend= or |+errend= and |-errend= Appends something after an uncertainty.

Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".

|u= or |ul= The unit code. Val adds a space and the unit.

|ul= Link the unit.
|u= Don't link the unit. Also accepts wiki markup in lieu of a unit code.
Galat skrip: tidak ada modul tersebut "DemoTemplate".

|up= or |upl= A unit code, but instead of a space Val adds a slash and the unit, a "per" unit (the denominator), to form a ratio.

|upl= Link the per unit.
|up= Don't link the per unit.
The ratio can be of two unit codes, or a prefix and a unit code. Val will add parentheses to disambiguate, if a unit code has a dot or a slash.
Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".

|p= Prefix the entire Val expression. Non-spaced, but accepts markup.

Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".

|s= Suffix the entire Val expression. Non-spaced, but accepts markup.

Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".

|e= Exponent. Val alternatively accepts e notation in the first parameter; these are mutually exclusive (see "1st" argument above).

Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".

|long scale= Usually a unit is the short ton and billion means Galat skrip: tidak ada modul tersebut "val".. But there are long versions of these units and others. Use |long scale=on to assign your unit to the long scale instead. The unit code's link will change and it will sort differently in tables. "See Long and short scales".
|nocategory= If set to any value, errors in the use of this template will not cause the page to be added to the Pages with incorrect formatting templates use category. This is useful for documentation and test pages that do not need to be fixed.

Errors

beccè'

There is strict checking on the validity of arguments; any incorrect use will result in an error. Pages that contain incorrect use of this template will show up on Category:Pages with incorrect formatting templates use.

Val checks for unsupported parameters and gives a relatively subtle warning if found. See tracking category to track any of these improper usages on existing on the wiki. Hold the mouse over "warning" to see details. Here is what warnings look like:

  • {{val|1.23|exp=6|u=m/s}}Galat skrip: tidak ada modul tersebut "val".
  • {{val|1.23|us=kbit/s}}Galat skrip: tidak ada modul tersebut "val".
  • {{val|1.23|.05|.04|.03|u=m/s}}Galat skrip: tidak ada modul tersebut "val".

Format of numbers

beccè'
  1. REEDIRECT Template:Template link
TemplateStyles' src attribute must not be empty. produces formatting compliant with Wikipedia's Manual of Style.

The 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 |fmt= (see above).

Sorting

beccè'

The sort key for each sortable unit is visible at Template:Val/list.

Here is a live example showing the minimal markup for a sortable table:

{| class="wikitable sortable floatright" summary="Val sorting test"
|+ Click to sort ↓
|-
! Val sort test
! In base unit
! {{nobold|1=(unsort)}}
|-
| {{val|3|ul=  Mm }}
| style="text-align:right" | {{val|3000000|u=m}}
| style="text-align:right; font-size:small;" | {{random number|100|1|67}}
|-
| {{val|4e6|ul= m }}
| style="text-align:right" | {{val|4000000|u=m}}
| style="text-align:right; font-size:small;" | {{random number|100|3|67}}
|-
| {{val|1|ul=  km }}
| style="text-align:right" | {{val|1000|u=m}}
| style="text-align:right; font-size:small;" | {{random number|100|5|67}}
|-
| {{val|5e3|u=  m }}
| style="text-align:right" | {{val|5000|u=m}}
| style="text-align:right; font-size:small;" | {{random number|100|7|67}}
|-
| {{val|2|u=    m }}
| style="text-align:right" | {{val|2|u=m}}
| style="text-align:right; font-size:small;" | {{random number|100|11|67}}
|}
|}
Click to sort ↓
Val sort test In base unit (unsort)
Galat skrip: tidak ada modul tersebut "val". Galat skrip: tidak ada modul tersebut "val". Cèṭa'an:Random number
Galat skrip: tidak ada modul tersebut "val". Galat skrip: tidak ada modul tersebut "val". Cèṭa'an:Random number
Galat skrip: tidak ada modul tersebut "val". Galat skrip: tidak ada modul tersebut "val". Cèṭa'an:Random number
Galat skrip: tidak ada modul tersebut "val". Galat skrip: tidak ada modul tersebut "val". Cèṭa'an:Random number
Galat skrip: tidak ada modul tersebut "val". Galat skrip: tidak ada modul tersebut "val". Cèṭa'an:Random number

A sort value relates to a Val expression as follows.

  1. The numeric value is a starting point.
  2. If the unit has an SI Prefix, that order of magnitude is applied.
  3. The value of the unit from its own system of units is applied.
  4. If the unit is composite, each subunit is multiplied or divided per their dimension.
  5. The result is passed to
  6. REEDIRECT Template:Template link
TemplateStyles' src attribute must not be empty. which applies a normalization formula.
  1. The output of {{ntsh}} is added (behaviorally only, i.e. "hidden") into the table as usual, via the data-sort-value attribute of a table.

More example expressions

beccè'

Number

beccè'

Galat skrip: tidak ada modul tersebut "DemoTemplate".
⟨{{val|  1234567.1234567   }}⟩ → ⟨Galat skrip: tidak ada modul tersebut "val".
Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".

Uncertainty

beccè'

Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".

Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".

Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".

Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".

Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".

Exponents

beccè'

Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".

Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".

Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".

Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".

Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".

Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".

Prefix/suffix

beccè'

Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".
Galat skrip: tidak ada modul tersebut "DemoTemplate".

Numerator/denominator

beccè'

Galat skrip: tidak ada modul tersebut "DemoTemplate".

Repeating digits

beccè'

{{val|1.2|end={{overline|34}}|e=7|ul=W|up=m2}}Galat skrip: tidak ada modul tersebut "val".

Even more examples

beccè'

See the testcases at

  1. REEDIRECT Template:Template link
TemplateStyles' src attribute must not be empty..

FAQ and comments

beccè'
Q. Why should I use Val?
A1. Val formats numbers:
A2. Val preserves spacing:
  • It makes sure the value does not wrap at the end of a line, so that it can always be read as a single value on one line in the text.
  • It spaces the various parts of the value where they should be.
A3. Configuring Val gives you your own code for automating the markup for, and a link to, any units in the entire Encyclopedia.
A4. Val helps make Wikipedia more consistent. It adheres to the Wikipedia Manual of Style for numbers. Updates to the MoS can be applied to this template and result in automatic modification on values that use it. All this makes sure all values on all pages have the same look and feel because they will all use the same spacing, font size, positioning, etc, and makes updating and checking by the bots easier because they can recognize a value for what it is.
Q. Why not use <math>?
A. For the same reasons HTML might be preferred over TeX:
  • Because the font in math tags differs both in face and size from the prose, which can disturb the layout of a page when used inline with the prose.
  • You cannot cut and paste a bitmap image rendered by the LaTeX.
  • Images are slower to load and use more bandwidth, which is especially bad for the mobile version of Wikipedia.
  • <math> does not automatically easily align to the Manual of Style for numbers.
Q. Are there any known issues with Val?
A1: This template is now a new Lua module as of Aug 6, 2015. Technically, there is no good reason not to try Val.
A2. Issues are solved rapidly by an active set of responsive template coders. See the talk page.
Q. How should I use Val?
A1. Val probably already has your unit on its current list. If not, add your own unit there.
A2. To avoid overlinking, switch from |ul= to |u= and from |upl= to |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
  1. REEDIRECT Template:Template link
TemplateStyles' src attribute must not be empty.. See how to add units to Convert.
A4. Where consistent styling of long list articles, with many hundreds or thousands of numbers or units is needed.

Redirects

beccè'

See also

beccè'

Cèṭa'an:Basepage subpage

TemplateData

beccè'
This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Val in articles based on its TemplateData.

TemplateData for Val

This template is used to easily present values in scientific notation, including uncertainty and/or units, as prescribed by Wikipedia's Manual of Style.

Parameter templat

Templat ini lebih menyukai format parameter dalam satu baris.

ParameterKeteranganJenisStatus
Number1

A number in decimal point notation or in e notation. The main basis of the Val expression.

Contoh
-12.12345e9
Katawajib diisi
Uncertainty2

tidak ada keterangan

Kataopsional
Asymmetric uncertainty -3

tidak ada keterangan

Kataopsional
Formatfmt

By default, numbers are formatted with gaps separating groups of three digits in both integer and fractional part. However, by default, four-digit integers are not formatted; use "gaps" (without quotes) to force gaps. Use the value "commas" (without quotes) to delimit the integer part of the number with commas. Use "none" (without quotes) for no formatting (no gaps or commas).

Nilai yang disarankan
gaps commas none
Contoh
commas
Kataopsional
Endend

Put something at the end of the main number (before anything else that might follow).

Kataopsional
Unitu

The unit code. A space and the unit will be added after the number.

Contoh
m
Kataopsional
Unit – wikilinkedul

The unit code that will be wikilinked to a page with information about the unit. A space and this unit will be added after the number.

Contoh
m
Kataopsional
Unit to be prefixed with a slash (/)up

A unit code, but instead of a space, the template adds a slash and the unit, a "per" unit (the denominator), to form a ratio.

Contoh
s
Kataopsional
Unit to be prefixed with a slash (/) – wikilinkedupl

A wikilinked unit code, but instead of a space, the template adds a slash and the unit, a "per" unit (the denominator), to form a ratio.

Contoh
s
Kataopsional
Prefixp

Prefix for the entire Val expression. Non-spaced, but accepts markup.

Isiopsional
Suffixs

Suffix for the entire Val expression. Non-spaced, but accepts markup.

Isiopsional
Exponente

Val alternatively accepts e notation in the first parameter; these are mutually exclusive (see the Number parameter).

Contoh
9
Angkaopsional
errenderrend

tidak ada keterangan

Tak dikenalopsional
44

tidak ada keterangan

Tak dikenalopsional
55

tidak ada keterangan

Tak dikenalopsional