Dota 2 Wiki

你现在尚未登录,许多功能可能无法正常使用,若已有账号,请登录,若没有,请先注册Twitch账号
目前我们有非常多的待翻译条目,你也可以看一下目前我们需要优先处理的有哪些目前我们有非常多的待翻译条目,你也可以看一下目前我们需要优先处理的有哪些英雄页面的攻略、克制和物品页面的推荐英雄、小贴士等均为社区玩家编写的,你也可以把自己的心得写上去哦。英雄页面的攻略、克制和物品页面的推荐英雄、小贴士等均为社区玩家编写的,你也可以把自己的心得写上去哦。看不懂技能的buff/debuff是哪个跟哪个?鼠标移动到名称上就能看到游戏内显示的名字和描述了。看不懂技能的buff/debuff是哪个跟哪个?鼠标移动到名称上就能看到游戏内显示的名字和描述了。目前我們沒有善於製作其他中文變體的人員,如果您善於或擁有相關技術,請幫忙補充其他中文變體的空白。目前我們沒有善於製作其他中文變體的人員,如果您善於或擁有相關技術,請幫忙補充其他中文變體的空白。

了解更多

Dota 2 Wiki
Advertisement
Dota 2 Wiki
3,958
個頁面

Template:Calculate的文檔 [ 查看 | 編輯 | 淨化 ]

Lua logo.svg
▶️ Swapsies!
This template uses Lua.
Its code can be found under 模塊:Calculate.


Usage

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 – Optional. Can be set to % in order to return the results as percentages.

Examples

  1. {{Calculate|v1+5|v1=1/2/3}}
    generates: 6/7/8.
  2. {{Calculate|v1*v2|v1=10/15/20/25|v2=0.25/0.5/0.75/1}}
    generates: 2.5/7.5/15/25.
  3. {{Calculate|v1/3 round2|v1=2/4}}
    generates: 0.67/1.33.
  4. {{Calculate|v1*80|v1=40%/70%/100%}}
    generates: 32/56/80.
  5. {{Calculate|v1-v2|%|v1=100%/150%/200%/250%|v2=50%/75%/100%/125%}}
    generates: 50%/75%/100%/125%.
  6. {{Calculate|(v1-0.3)/5*0.1|v1=1.75/2.5/3.25/4}}
    generates: 0.029/0.044/0.059/0.074.
  7. {{Calculate|(v1-1)*12%|%|v1=125%/175%/225%/275%}}
    generates: 3%/9%/15%/21%.

TemplateData

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.

布林值選填
Advertisement