Predefinição:Convert/doc
Esta página ou secção está a ser traduzida. Ajude e colabore com a tradução. |
Esta é uma subpágina de documentação para a Predefinição:Convert. Ela contém informações sobre o seu uso, categorias, bem como todo o conteúdo que não faz parte da predefinição original. |
A predefinição {{Convert}} foi depreciada. Favor usar {{Converter}} em vez dela. |
Esta predefinição emprega sintaxe possivelmente complexa.
Ela faz uso de características complicadas e esotéricas de sintaxe de predefinições. Por favor não tente alterar algo a menos que esteja certo de que compreende a montagem e esteja preparado para reparar danos colaterais se os resultados forem inesperados. Sempre considere usar a predefinição de testes ou seu espaço de usuário para experimentações antes de qualquer modificação significativa. |
Esta predefinição pode ser utilizada para mostrar a medição das quantidades como primária e unidades convertidas secundárias, opcional com abreviatura ou barra, tais como a distância "32 metros (Erro de expressão: Carácter de pontuação "," não reconhecido pé)" ou temperatura "Predefinição:Convert/°C" ou "Predefinição:Convert/°C" com opcional grafias E.U. ou hifenização.
Uso
Valor único:
{{convert|original_value|original_unit|conversion_unit|round_to|...}}
Faixa de valores (ver abaixo na lista de range opções):
{{convert|orig_val1|range|orig_val2|original_unit|conversion_unit|round_to|...}}
- Numbers must be entered in unformatted form (without commas). For negative numbers (i.e. temperatures or precision) use a hyphen as the minus sign for the input number. Values output by the template will be displayed formatted and with a true minus sign where appropriate.
- Optional parameters, in examples below, allow abbreviated units (abbr=on), or US spellings (sp=us for meter), or slash separation (disp=s), or hyphenation (adj=on), etc.
- For this template many levels of substituição are possible, hence doing this fully, step by step, is cumbersome, use Special:ExpandTemplates instead.
- The template has no in-built capacity for Análise dimensional. It is therefore up to the user to ensure that the input and output units are compatible. Do not, for example, attempt to convert barrels to tonnes (but see
{{bbl to t}}
). Also beware of units with similar names; the codeoz
, for example, is for the avoirdupois ounce (a unit of mass), do not use this if you want fluid ounces. - The range functionality is not fully implemented for all units, so experimentation may be required.
- This documentation page tends to lag behind in terms of what the template can do. For details see the talk page and its archives.
Examplos
Valor único
Entrada | Mostra como |
{{convert|3.21|kg|lb}} | 3,21 quilogramas (Erro de expressão: Carácter de pontuação "," não reconhecido lb) |
{{convert|3.21|kg|lb|0}} | precision_format| 7,0 768 386 161 346 | 0}} lb) |
{{convert|0|kg|lb}} | 0 quilogramas (0 lb) |
{{convert|6|ft|5|in|m}} | Predefinição:Convert/and/in |
{{convert|18|°C|°F}} | Predefinição:Convert/°C |
{{convert|1250|sqft|m2|lk=in|sigfig=2}} | Predefinição:Convert/sqft Veja que 'lk=in' aplica link apenas para unidade de entrada. Este exemplo é somente para ilustração, unidades comuns de medição não devem ser lincadas. Ver: wp:overlink. |
{{convert|20.5|km2|sqmi|lk=out|abbr=on}} | Predefinição:Convert/LoutAonDbSoff Veja que 'lk=out' aplica link apenas para unidade de saída. Este exemplo é somente para ilustração, unidades comuns de medição não devem ser lincadas. Ver: wp:overlink. |
{{convert|641|acre (unidade)|km2 sqmi|lk=on}} | Predefinição:Convert/acre (unidade) Veja que 'lk=on' aplica links para unidades de entrada e saída. Este exemplo é somente para ilustração, unidades comuns de medição não devem ser lincadas. See: wp:overlink. |
{{convert|641|acre (unidade)|km2 sqmi|2|lk=on}} | Predefinição:Convert/acre (unidade) Note that because 640 acres equals one square mile; 641 acres rounded to two decimal places equals 1.00 sq mi. |
Faixa de valores
- Nota: ainda não operacional para todas as unidades
Entrada | Mostra como |
{{convert|60|and|170|kg|lb}} | 60 and 170 quilogramas ({{#invoke:Math|precision_format| ( 60 )*((0,5)+(0)+1*2-((0,5)+(0)+1))/0,45 359 237 | 1−2 }} and{{#invoke:Math|precision_format| ( 170 )*((0,5)+(0)+1*2-((0,5)+(0)+1))/0,45 359 237 | 1−2 }} lb) |
{{convert|60|to|170|kg|lb}} | Predefinição:Convert/to |
{{convert|60|to(-)|170|kg|lb}} | Predefinição:Convert/to(-) |
{{convert|60|-|170|kg|lb}} | Predefinição:Convert/- |
{{convert|60|by|120|m|ft}} | Predefinição:Convert/by |
{{convert|60|x|120|m|ft}} | Predefinição:Convert/x |
{{convert|60|+/-|10|m|ft}} | Predefinição:Convert/+/- |
A seguinte série de conversões não estão atualmente disponíveis:
- Temperature-based units (°C para °F, etc.) devido à complexidade da conversão
- Imperial and US gallon-based units
- Fuel consumption units (mpg, L/100km)
- Large scale units (e3, e6, e9)
- Combination-based units (ft&in, st&lb, lb&oz) devido à complexidade da conversão
Parâmetros
Use US spelling | attach |sp=us
|
Make units wikilinked | attach |lk=on to link all unitsattach |lk=in to link only the input unitsattach |lk=out to link only the output units(The manual of style suggests that you should not link common units of measurement). |
Use the adjective form | attach |adj=on (e.g. "The 190-foot (58 m) bridge" as opposed to "The 190 feet..."). This produces the adjective form—the unit name in the singular with a hyphen (according to the Manual of Style).
|
Abbreviate all units | attach |abbr=on
|
Use a / instead of ( ) | attach |disp=s (or |disp=/ ) (e.g. 190 foot/58 metre). Note that when using slashes all unit names either spelt out in full or abbreviated (where there exists an abbreviation).
|
Use in a table | attach |disp=table Note: For use in tables the template must start on a new line after a pipe. Only the number will be displayed unless you set |abbr=on , |lk=on , |lk=in or |lk=out . Example: here
|
Round to a specified number of significant figures | attach |sigfig={some non-negative integer} . In the case of temperatures Celsius or Fahrenheit this refers to the difference with the absolute-zero temperature. For example, at room temperature two significant digits means rounded to tens of degrees.
|
Let Convert decide the unit to convert to | precision_format| 160,9 344 | 0}} km). |
Display input value as a fraction | precision_format| 9,525 | 3}} mm) or {{convert|11+1/4|in|cm|2|abbr=on}}→11+1/4 in (Predefinição:Convert/cm) |
Parâmetros ainda em construção
Parâmetros ainda em construção. Pode não funcionar em todas as situações | |
---|---|
disp=ou | Similar ao disp=s exceto a palavra "ou" será colocado entre os valores. Atualmente não trabalho com várias conversões (por exemplo, Litros para os EUA, e galões imperiais) ({{convert|20|mi|km|disp=or}})--->(Predefinição:Convert/LoffAoffDorSoff) |
disp=tablecen | Similar ao disp=table exceto que os valores estarão centrados dentro da coluna. Ver as tabelas na La Nouvelle branch nos exemplos de uso. |
Rounding
Convert supports four types of rounding:
- Rounding to a given precision
- Specify the desired precision with the fourth unnamed parameter or third unnamed parameter in the case where the convert to parameter is skipped (see above). The conversion is rounded off to the nearest power of 1/10 this number. For instance, if the result is 8621 and the round number is '-2', the result will be 8600. If the result is '234.0283043' and the round number is '0', the result will be 234.
- Rounding to a given number of significant figures
- Specify the desired number of significant figures using
|sigfig={some non-negative integer}
as noted above.
- Combine both of the above
- If both the desired precision and the desired number of significant figures are specified, the conversion will be rounded to the least precise of these.
- Default rounding
- If neither the desired precision nor the desired number of significant figures are specified, the conversion will be rounded either to a comparable precision as the input value (the number of decimals remains the same if the conversion is a multiplication by a number between 0.2 and 2, is decreased by 1 if the factor is between 2 and 20, etc.) or to two significant figures whichever is the most precise. An exception to this is temperature wherein the conversion will be rounded either to precision comparable to that of the input value or to that which would give three significant figures when expressed in kelvin, whichever is the most precise.
Unidades suportadas
- Ver também: Convert/lista de unidades
A tabela abaixo lista unidades suportadas por esta predefinição. Ela é dividida de acordo com a quantidade a ser medida. Nem todas as unidades suportadas estão listadas aqui, há links para listas completas para cada quantidade. Os códigos listados na coluna código (coluna 3) são aceitos como entrada pela predefinição. Estes podem ser usados como o segundo ou terceiro parâmetro sem nome. Para algumas unidades existem códigos alternativos. Eles estão listados entre parênteses e foram incorporados para tornar o código mais flexível para os editores, e.g. °F ou F podem ser inscritos.
Os códigos referidos nas colunas de combinações (coluna 7) pode ser usada para produzir conversões múltiplas. Eles só podem ser utilizados como o terceiro parâmetro sem nome, ex. {{convert|55|nmi|km mi}}
produz "Predefinição:Convert/nmi".
Exemplos
- Monitor de qualidade ou olhar os exemplos de
{{Convert/check}}
.
Ver também