Шаблон:Calculate/doc

Материал из Dota 2 Вики
Перейти к: навигация, поиск

Использование[править]

Use this template when calculating with one or more values in the form of a sequence (e.g. 1/2/3).

{{Calculate|expr.|v1=|...|vn=|percent}}
  • expr. – The intended calculation in the form of a mathematical expression, with v1...vn representing the respective value sequences, e.g. v1+v2. Supports percentages, e.g. v1*50%, which is automatically converted to v1*0.5. Follows the same rules as the parser function #expr.
  • v1,...,vn – Each sequence of values has to be set as a separate parameter vn, with n representing its index number, e.g. v1=1/2/3. Supports percentages, e.g. v1=1%/2%/3%.
  • percent – Опциональный. Can be set to % in order to return the results as percentages.

Примеры[править]

  1. {{Calculate|v1+5|v1=1/2/3}}
    генерирует: 6/7/8.
  2. {{Calculate|v1*v2|v1=10/15/20/25|v2=0.25/0.5/0.75/1}}
    генерирует: 2,5/7,5/15/25.
  3. {{Calculate|v1/3 round2|v1=2/4}}
    генерирует: 0,67/1,33.
  4. {{Calculate|v1*80|v1=40%/70%/100%}}
    генерирует: 32/56/80.
  5. {{Calculate|v1-v2|v1=100%/150%/200%/250%|v2=50%/75%/100%/125%|%}}
    генерирует: 50%/75%/100%/125%.
  6. {{Calculate|(v1-0.3)/5*0.1|v1=1.75/2.5/3.25/4}}
    генерирует: 0,029/0,044/0,059/0,074.
  7. {{Calculate|(v1-1)*12%|v1=125%/175%/225%/275%|%}}
    генерирует: 3%/9%/15%/21%.

Данные шаблона[править]

Use this template when calculating with one or more values in the form of a sequence.

Параметры шаблона

Этот шаблон предпочтительно использует внутристрочное размещение параметров.

ПараметрОписаниеТипСтатус
Calculation1

The calculation with v1, v2, ... in place of the levelled values.

Пример
v1+3
Строкаобязательный
Value 1v1

A levelled value with levels separated by a forward slash.

Пример
1/2/3/4
Неизвестнообязательный
Value 2v2

A levelled value with levels separated by a forward slash.

Пример
1/2/3/4
Неизвестнопредложенный
Percentage2

Set this parameter to activate sprecial percentage handling.

Булевонеобязательный