Bản mẫu:Giá trị/doc

This template is used to easily present values in scientific notation, including uncertainty and/or units, as prescribed by Wikipedia's Manual of Style.
Chú ý: Các tham số đầu vào phải tuân theo quy tắc tiếng Việt: 1.234,5678 hoặc 1234,5678, chứ không phải 1,234.5678.

**Sự giới thiệu**
Val stands for the number value that is its first parameter. Val specializes in scientific notations and uncertainty notations, and in a measurement value with physical units.  It formats the number (with possible unit) according to the Manual of Style and keeps the expression from wrapping across lines.
Express a numeral:-  → value, formated with gaps: 123456.78901, or with commas → 1234.5678901. -  → value ± uncertainty,  like 56-  → value(uncertainty), like (56).-  →value b=−uncertainty like -78
Express a measurement value with a unit, for example  ul=m/s2. The keyboard characters m/s2 are a "unit code" that m/s2 marks up, or that m/s2 additionally links to its articulation.

Because the unit spacing and markup is a style issue, Val provides these for you. 
There are a large number of unit codes that Val understands and keeps "up to code".  A unit code is usually composed of one or more abbreviated unit names and the usual math symbols on the typical keyboard.  See 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 form a ratio or not with a unit code.-  → number markup , such as u=m/s2-  → number markup, such as ul=m/s2-  → number markup/markup, such as upl=s2-  → markup/markup, such as up=s2
To bypass the unit code system, if u does not recognize your unit code, it will accept any wikitext and render it as usual.- #gọi:DemoTemplate|val|5.4|u=kg⋅m/s2 - #gọi:DemoTemplate|val|7.6|u=m/s2
See below 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.- s=
See val/testcases to learn the val parameters by a example. It's comprehensive, and there's over 100 examples.

**Arguments**

**Các lỗi**
There is strict checking on the validity of arguments; any incorrect use will result in an error, which is displayed using FormattingError. Pages that contain incorrect use of this template will show up on :Category:Pages with incorrect formatting templates use.

**Định dạng của các số**
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).

**Sắp xếp**
A hidden sort key is added to the output for sorting in sortable tables.  The sort key is based on the main value (parameter 1) and, if used, the exponent for the power of 10 (parameter e) and/or units (parameters u, ul, up and/or upl).  Where necessary, units are converted to base SI units for the purpose of the sort key, which is produced by ntsh.  Several units are covered; see How to add units for those which are not. To omit the sort key use off.

**Ví dụ**
Number
Uncertainty
Units
Exponents
Prefix/suffix
Numerator/Denominator
Even more examples
See the testcases at val/testcases.

**Performance impact**
For very long list articles with hundreds of numeric entries, load times for that page will be much much faster by using html.  No templates can compete with HTML on, for example List of nuclides.
Performance data is reported by MediaWiki software in the HTML page source of every page, and a very similar report is available on any preview page, below the edit box, titles "Parser profile data". For using Val inside other templates, note the performance parameter in these reports, called "Highest expansion depth".  Numbers with fractional parts cost more Val-expansion depth than numbers with only integer parts.
For uses in any other page besides long list articles, Template:Val will have no noticeable impact on CPU time contributions to page-load times.

**How to add units**
Add the unit to Bản mẫu:Val/units. Val defaults to looking up units at Convert, but units added here override that.
Note these points about composite units before adding units:- For composite units you should probably link the whole, not individual units. For example the line you add would say  linking to Metre per second, not .
List of common physics notations has many examples of composite units that have their own page.- The val user can compose their own divisor unit from an existing unit, for example writing  to render their own "upl=s" with two links:  m to Meter and s to Second.  - The val user can compose their own multiplier units by using the end parameter to prepend a string.  For example, in a geology article, to prepend "Ma", to the unit in ul=uBP, use #gọi:DemoTemplate|val|333|end= Ma|ul=uBP". (The end parameter accepts wikitext, so it can be linked.)
After adding a unit, you can ensure that it sorts correctly in a table, especially if there are ten or twenty variations that differ only by an SI prefix. 
(See Sorting above and Bản mẫu:Val/sortkey/unit.)

**FAQ and comments**
 Q: Why should I use Val?
 A1: Val formats numbers: 
*inserts spaces between groups of digits, approximating SI standards
*properly formats uncertainties in measurements and significant digits, providing a ± character, etc.
*properly formats exponents of 10 and scientific notation
*replaces "-" (hyphen) with a "−"  (minus sign)
 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 ?
 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.-  does not automatically easily align to the Manual of Style for numbers.- Q: Are there any known issues with Val?
 A1: This template has been in full use on many pages for quite some time without major problems or breaking changes. 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, then your unit can be added. 
 A2: To avoid over linking switch from ul to u and from upl to up.
 A3: Use Val along with Convert.  See how to add units to Convert.

**Xem thêm**
  subtemplates:
*: Val/units, for the list of customized units, their markup, their link, and to configure your own codename for your own unit (whose name you choose goes into any of the named parameters with the letter u in there names).
*: Similarly Val/angle, for the handling of unspaced units.
*: val/delimitnum, for setting your own delimiters between groups of digits instead of using the default (spaces). 
*: Val/sortkey/unit for guaranteeing table sorting- formatting error, to fix inconsistencies when the error you are given is not the error you find you have.