الگو:تبدیل

از ويکی شيعه
پرش به: ناوبری، جستجو
توضیحات الگو[نمایش] [ویرایش] [تاریخچه] [پاکسازی]


دوستانی که علاقمند به فارسی سازی یکاهای این الگو هستند قبل از هر تغییری لطفا بهراهنمای الگوی تبدیل مراجعه کنند.

استفاده

این الگو توانایی تبدیل یکاها را به همدیگر دارد و برای آشنایی با یکاها و حروف اختصاری آنها به فهرست یکاها مراجعه کنید.

"الگو:Convert/m" یا برای دما"الگو:Convert/°C" یا "الگو:Convert/°C"

یک متغییر:

{{تبدیل|عدد|یکا اول|یکا دوم|روند گردد|...}}


{{تبدیل|عدد اول بازه |حرف ربط -.و. یا. با. تا. X |عدد دوم بازه|یکا اول|یکا دوم|round_to|...}}

جزئیات

جزئیات
Use US spelling attach |sp=us
Make units wikilinked attach |lk=on   to link all unitsالگو:In5(default: lk=off)
attach |lk=in   to link only the input units
attach |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, or insert mid-text words 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).
attach |adj=mid (e.g. "The 190-foot bridge (58 m)" as: |adj=mid|bridge, or "The 190-foot-long bridge (58 m)" as: |adj=mid|-long bridge)
الگو:In5Any rounding-parameter should follow the mid-text: "text|0".
Abbreviate units, or not attach |abbr=onالگو:In5to show unit symbolsالگو:In5(default: abbr=off)
attach |abbr=none   to show all unit names in full words
attach |abbr=in الگو:In5 to abbreviate input units
attach |abbr=outالگو:In5to abbreviate output units
attach |abbr=valuesالگو:In5to suppress unit names & show only values. So, {{convert|6|mi|abbr=values}} gives: خطای اسکریپتی: پودمان «convert» وجود ندارد..
Change "( )" to display other separators attach |disp=commaالگو:In5to put comma, not brackets/parentheses
attach |disp=orالگو:In5to put "or" between units
attach |disp=s (or |disp=/) for slash (e.g. 190 foot/58 metre). The default value is:  disp=b for brackets/parentheses.
Change "( )" to customized separators attach |disp=x| (begin | end)الگو:In5to show "xx (begin yy end)"
attach |disp=x|;الگو:In5to show "xx; yy"
attach |disp=x| (same as |)الگو:In5to show "xx (same as yy)".
Display output only attach |disp=output only الگو:In5 to show result number & unit
attach |disp=output number onlyالگو:In5to show just number
Note when using "disp=output only" then the unit name can still be shown as full words by abbr=none, or linked by lk=on.
Display units inverted as reverse order attach |disp=flip الگو:In5 to reverse the order & show output unit first
So, {{convert|6|km|disp=flip}} shows "3.2 mi (6 kilometres)".
To get symbol "km" use abbr=in, to abbreviate the input unit.
Display unit name (only) attach |disp=unit الگو:In5 to show the unit name for a symbol
The unit name will be plural when the amount is not 1, or hyphenated when adj=on. So, {{convert|2|cuyd|disp=unit}} shows "cubic yards" plural.
Display amounts as table cells attach |disp=table (or |disp=tablecen) 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.
Round by 5 attach |disp=5  to round the output amount to the nearest 5 units. Not supported for all options.
Let Convert decide the unit to convert to skip the precision parameter (the 3rd or 4th unnamed parameter) e.g. {{convert|100|km|kn}} gives خطای اسکریپتی: پودمان «convert» وجود ندارد. and {{convert|100|km}} gives خطای اسکریپتی: پودمان «convert» وجود ندارد..
Display input value with a fraction {{convert|3/8|in|mm|3|abbr=on}} خطای اسکریپتی: پودمان «convert» وجود ندارد. or {{convert|11+1/4|in|cm|2|abbr=on}}خطای اسکریپتی: پودمان «convert» وجود ندارد.

For negative amounts, use 2 minus signs: -11-1/4.

Generate a hidden sort key for use with a sortable table attach |sortable=on to generate a hidden sort key (in the form of <span style="display:none">00000005</span>) so that sortable tables will sort correctly. This takes the first numeric value and left pads it with zeros to 16 places. It ignores any additional values, ie, if you use 6|ft|2|in as the value, it will only use the 6 for the sort key. This will cause numeric values to sort in numeric order, ie: 5, 10, 15 instead of 10, 15, 5.

Parameters still under construction

Parameters still under construction. May not work in all situations
disp=or Similar to disp=s except the word "or" will be placed between the values. Does not currently work with multiple conversions (e.g. Liters to U.S. and imperial gallons) ({{تبدیل|20|mi|km|disp=or}})--->(الگو:Convert/mi)
disp=tablecen Similar to disp=table except that the values with be centered within the column. See the tables at La Nouvelle branch for in use examples.

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.

Units supported

The table below lists units supported by this template. It is divided up according to the quantity being measured. Not all supported units are listed here; there are links to complete lists for each quantity.

The codes listed in the code column (column 3) are accepted as input by the template. These can be used as the second or third unnamed parameter. For some units there exist alternative codes. These are listed in brackets and have been incorporated to make the code more flexible for editors, e.g. °F or F may be entered.

The codes listed in the combinations column (column 7) can be used to produce multiple conversions. They can only be used as the third unnamed parameter, e.g. {{تبدیل|55|nmi|km mi}} produces "الگو:Convert/nmi".

مثال های دیگر

  • برای نشان دادن کیفیت الگو به {{Convert/check}}مراجعه کنید.

See also

قالب:ab:Convert تحرير قالب:ab:Convert