Difference between revisions of "Template:Number"
Jump to navigation
Jump to search
(Add example usage) |
(Update templatedata) |
||
Line 26: | Line 26: | ||
"description": "Add an optional suffix to the number", | "description": "Add an optional suffix to the number", | ||
"example": "%", | "example": "%", | ||
+ | "type": "string" | ||
+ | }, | ||
+ | "sortkey": { | ||
+ | "label": "Sort Key", | ||
+ | "description": "Specify a custom sort key to override default table number sorting", | ||
+ | "example": "Z", | ||
"type": "string" | "type": "string" | ||
} | } |
Revision as of 23:15, 19 March 2021
Display a large number in named and/or scientific notations, matching in-game formatting
Parameter | Description | Type | Status | |
---|---|---|---|---|
Number | 1 | The number to display (in long form or scientific notation)
| Number | required |
Format | format | Force a specific format (named or scientific). If blank, displays both named and scientific (preferred)
| String | optional |
Prefix | prefix | Add an optional prefix to the number
| String | optional |
Suffix | suffix | Add an optional suffix to the number
| String | optional |
Sort Key | sortkey | Specify a custom sort key to override default table number sorting
| String | optional |
Examples
Input | Output |
---|---|
{{Number|120000}} |
120,000 |
{{Number|18000000000}} |
18 B (1.8e10) |
{{Number|12456712473}} |
12.457 B (1.246e10) |
{{Number|7.4e87}} |
7.4 OcV (7.4e87) |
{{Number|5E+34|format=named}} |
50 De |
{{Number|3.50e+09|format=scientific}} |
3.5e9 |
{{Number|3555|prefix=$}} |
$3,555 |
{{Number|1.8e12|suffix=%}} |
1.8 T% (1.8e12%) |
{{Number|2e308}} |
Infinity |