Predefinição:Val/Testes
![]() | Esta predefinição não apresenta nenhuma documentação. Por favor, documente-a caso a saiba usar ou tenha conhecimentos para tal. |
![]() | Esta é a página de testes de predefinições de Predefinição:Val (dif). Ver também exemplos para testes na subpágina acompanhante. |
Descrição
Esta predefinição é utilizada para facilmente mostrar valores em notação científica, incluindo incerteza ou/e unidades, de acordo com o manual de estilo da wikipédia. O resultado é incluído em um bloco {{nowrap}}
, e assim mostra-se sempre num bloco inteiro no fim da linha. (Ver WP:LE para mais informação na utilização de espaços sem quebras.)
Argumentos
Existem quatro formas desta predefinição ser usada:
{{val|''número''}}
- for displaying values without uncertainty/significance.{{val|''número''|''uncertainty''}}
- for displaying values with uncertainty like so Erro Lua em package.lua na linha 80: module 'Módulo:Convert' not found..{{val|''número''|''upper uncertainty''|''lower uncertainty''}}
- for displaying values with uncertainty like so Erro Lua em package.lua na linha 80: module 'Módulo:Convert' not found..{{val|''número''|(''significance'')}}
- for displaying values with significance like so Erro Lua em package.lua na linha 80: module 'Módulo:Convert' not found..
They all take roughly the same arguments
1 | The value (must be a valid number) |
2 | The (upper limit of) uncertainty (must be a valid number) or significance (must be a valid number in parenthesis) |
3 | The lower limit of uncertainty (must be a valid negative number) |
e | The exponent for the power of 10 (optional). This will show up in the result as as " × 10e ". |
Values (arguments 1-3 and e) are run through code copied from {{delimitnum}} for readability, except for argument 2 when it is surrounded by parenthesis. This currently causes an error for large numbers, numbers that require high precision and numbers that have zeros after the decimal point. This last issue is being addressed, the other issues require changes to the Wikipedia software.
| |
u / ul | The units for the number (optional, with/without a link to the page about the unit respectively). |
up / upl | The units per for the units (optional, requires u to be specified, with/without a link to the page about the unit respectively). |
Units (specified by u, ul, up and upl) are replaced by a more esthetically pleasing HTML representation and get a link (ul and upl only, if they are in the list found in
{{val/units}} or if they are supported by {{convert}} ). You can specify units using just u; a good example is "ul=m/s", which gets translated to "m·s-1", or you can use u e up, as in "u/up"; a good examples if "ul=m|up=s", which gets translated to "m/s". | |
p | A prefix for the value (such as ∆, Ø, etc.., optional). |
s | A suffix for the value (such as %, optional). |
Prefixes (specified by p) and suffixes (specified by s) are put in front of or behind the value as is: this includes spaces. They are inside the nowrap block and will always be on the same line as the value. The parameters that previously provided this functionality (h for header and f for footer) are deprecated and will be ignored.
| |
end | Appends something after the main value. For example, {{val|123.24|end=...}} gives Erro Lua em package.lua na linha 80: module 'Módulo:Convert' not found. |
errend | Appends something after the uncertainty. For example, {{val|123.23|end=...|2.34|errend=...}} gives Erro Lua em package.lua na linha 80: module 'Módulo:Convert' not found. |
Predefinição:Nobr & Predefinição:Nobr | Appends something after the positive/negative uncertainties. For example, {{val|123.23|end=...|+2.34|+errend=...|-1.23|-errend=...}} gives Erro Lua em package.lua na linha 80: module 'Módulo:Convert' not found. |
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. |
See {{val/test}}
for a list of examples of the correct output of {{val}}
and the errors it may return when incorrectly used.
Errors
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.
Format convention
As mentioned before, {{val}}
should produce formatting compliant with the wikipedia manual of style. It currently produces formatting compliant with the U.S. Government Printing Office Style Manual, in rules 12.9e and 12.14, which requires that the decimal separator be a full stop; i.e. “decimal point” (.), requires comma-delimiting to the left of the decimal point for numbers with four or more digits to the left (values of Erro Lua em package.lua na linha 80: module 'Módulo:Convert' not found. or more), and also requires space-delimiting to the right of the decimal point for numbers containing five or more digits to the right (e.g., Erro Lua em package.lua na linha 80: module 'Módulo:Convert' not found. and Erro Lua em package.lua na linha 80: module 'Módulo:Convert' not found. and Erro Lua em package.lua na linha 80: module 'Módulo:Convert' not found.).
Note that if {{val}} is used on numbers simultaneously comprising four or more digits to the left of the decimal point and five or more digits to the right, the resultant expression will delimited with commas left and spaces (actually non-selectable, non-breaking, narrow gaps) right (e.g., Erro Lua em package.lua na linha 80: module 'Módulo:Convert' not found.).
Predefinição:Documentação dos parâmetros
Exemplos
{{val|1234567890}}
→ Erro Lua em package.lua na linha 80: module 'Módulo:Convert' not found. {{val|1.23456789}}
→ Erro Lua em package.lua na linha 80: module 'Módulo:Convert' not found. Incerteza/importância {{val|1.234|0.005}}
→ Erro Lua em package.lua na linha 80: module 'Módulo:Convert' not found. {{val|1.234|+0.005|-0.006}}
→ Erro Lua em package.lua na linha 80: module 'Módulo:Convert' not found. {{val|1.234|(5)}}
→ Erro Lua em package.lua na linha 80: module 'Módulo:Convert' not found. Expoentes/unidades {{val|1.234|e=5|u=m}}
→ Erro Lua em package.lua na linha 80: module 'Módulo:Val/units' not found. {{val|1.234|e=5|u=m2}}
→ Erro Lua em package.lua na linha 80: module 'Módulo:Val/units' not found. {{val|1.234|e=5|ul=m}}
→ Erro Lua em package.lua na linha 80: module 'Módulo:Val/units' not found. {{val|1.234|0.056|e=7}}
→ Erro Lua em package.lua na linha 80: module 'Módulo:Convert' not found. {{val|1.23456|+0.00007|-0.00008|e=-9|ul=m/s}}
→ Erro Lua em package.lua na linha 80: module 'Módulo:Val/units' not found. {{val|1.234|0.056|e=7|ul=psi}}
→ Erro Lua em package.lua na linha 80: module 'Módulo:Val/units' not found. {{val|123.4|ul=USgal}}
→ Erro Lua em package.lua na linha 80: module 'Módulo:Val/units' not found. {{val|12.34|ul=mpgimp}}
→ Erro Lua em package.lua na linha 80: module 'Módulo:Val/units' not found. Prefixo/sufixo {{val|p=Δ |12.34|s=%}}
→ Erro Lua em package.lua na linha 80: module 'Módulo:Convert' not found.
Ver também
{{val/units}}
{{val/unitswithlink}}
{{val/delimitnum}}
{{val/delimitnum/firstgroup}}
{{val/delimitnum/group}}
{{val/delimitnum/logic}}
{{val/delimitnum/real}}
A documentação acima é transcluída de Predefinição:Val/doc. (editar | histórico) Editores podem experimentar nas páginas de teste (editar | dif) e de exemplos para testes (editar) desta predefinição. Por favor adicione categorias à subpágina /doc. Subpáginas desta predefinição. |