Template:DPS: Difference between revisions
From Space Station 14 Wiki
Created page with "<includeonly>{{#if: {{{1|}}}|{{#if: {{{2|}}}||{{error|Fire rate parameter (second) not provided}}<!---->}}|{{error|Damage parameter (first) not provided}}<!---->}}<!-- -->{{#vardefine: res_exact|{{#expr: {{{1}}} * {{{2}}}}}<!---->}}<!-- -->{{#vardefine: res_round|{{#expr: {{#var:res_exact}} round {{{round|1}}}}}<!---->}}<!-- -->{{#ifeq: {{#var:res_exact}}|{{#var:res_round}}||≈}}{{#var:res_round}}</includeonly><noinclude> {{docs}} Category:Damage templates Cate..." |
No edit summary |
||
Line 5: | Line 5: | ||
-->{{#ifeq: {{#var:res_exact}}|{{#var:res_round}}||≈}}{{#var:res_round}}</includeonly><noinclude> | -->{{#ifeq: {{#var:res_exact}}|{{#var:res_round}}||≈}}{{#var:res_round}}</includeonly><noinclude> | ||
{{docs}} | {{docs|bb= | ||
{{has alias template|dps}} | |||
}} | |||
[[Category:Damage templates]] | [[Category:Damage templates]] |
Latest revision as of 11:48, 12 May 2025
Has an alias
This template has an alternative name:
Usage
{{dps
Example
Simple
{{dps
↓
32
With rounding
{{dps
↓
≈8.3
With a damage type template
{{damage|blunt|{{dps|8|4}}}}
↓
32 blunt
Errors
No fire rate provided
{{dps
↓
Fire rate parameter (second) not provided≈Expression error: Unexpected < operator.
No damage provided
{{dps}}
↓
Damage parameter (first) not provided≈Expression error: Unexpected < operator.Calculates DPS based on damage (first parameter) and fire rate per second (second parameter). By default, the resulting value is rounded to 1 digit. If rounding happens, an approximately equal sign "≈" will be added.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Damage | 1 | no description
| Number | required |
Fire rate (per second) | 2 | no description
| Number | required |
Round | round | Digits to round.
| Number | suggested |