Difference between revisions of "User:Tumbolisu/Sandbox/doc"
< User:Tumbolisu | Sandbox
m (Add another test case) |
m ([nit]) |
||
Line 32: | Line 32: | ||
| {{User:Tumbolisu/Sandbox | NUM = 999.1111 | P = 2 }} | | {{User:Tumbolisu/Sandbox | NUM = 999.1111 | P = 2 }} | ||
|- | |- | ||
− | | {{User:Tumbolisu/Sandbox | NUM = 33.343| POSTFIX = % }} | + | | {{User:Tumbolisu/Sandbox | NUM = 33.343 | POSTFIX = % }} |
|- | |- | ||
− | | {{User:Tumbolisu/Sandbox | NUM = 33.343| P = 0 | POSTFIX = &&& }} | + | | {{User:Tumbolisu/Sandbox | NUM = 33.343 | P = 0 | POSTFIX = &&& }} |
|- | |- | ||
| {{User:Tumbolisu/Sandbox | NUM = 19 | POSTFIX = % | FORMAT = BI}} | | {{User:Tumbolisu/Sandbox | NUM = 19 | POSTFIX = % | FORMAT = BI}} | ||
Line 58: | Line 58: | ||
| {{User:Tumbolisu/Sandbox | NUM = 33.343 | POSTFIX = % }} | | {{User:Tumbolisu/Sandbox | NUM = 33.343 | POSTFIX = % }} | ||
|- | |- | ||
− | | {{User:Tumbolisu/Sandbox | NUM = 33.343| P = 0 | POSTFIX = &&& }} | + | | {{User:Tumbolisu/Sandbox | NUM = 33.343 | P = 0 | POSTFIX = &&& }} |
|- | |- | ||
| {{User:Tumbolisu/Sandbox | NUM = 19 | POSTFIX = % | FORMAT = BI}} | | {{User:Tumbolisu/Sandbox | NUM = 19 | POSTFIX = % | FORMAT = BI}} |
Revision as of 04:55, 2 June 2023
This template is useful for stacking values in a table, where the numbers should be aligned based on the decimal separator. This template takes three arguments:
Argument | Meaning |
---|---|
NUM | Number to format |
P | Number of places after the decimal separator, defaults to three. |
POSTFIX | String to append to the end of the number, such as a % symbol.
|
FORMAT | B for Bold, I for Italic, and BI or IB for Bold Italic |
TOOLTIP | Hover tooltip for the entire number, including POSTFIX if present. |
So in example, the following table construct:
{| class="wikitable grid" |- ! class = "header" | Numbers |- | {{User:Tumbolisu/Sandbox | NUM = 123.456789}} |- | {{User:Tumbolisu/Sandbox | NUM = 123.456789 | P = 0}} |- | {{User:Tumbolisu/Sandbox | NUM = 123}} |- | {{User:Tumbolisu/Sandbox | NUM = {{#expr: 24 * 6 /11}}}} |- | {{User:Tumbolisu/Sandbox | NUM = 999.1111 | P = 2 }} |- | {{User:Tumbolisu/Sandbox | NUM = 33.343 | POSTFIX = % }} |- | {{User:Tumbolisu/Sandbox | NUM = 33.343 | P = 0 | POSTFIX = &&& }} |- | {{User:Tumbolisu/Sandbox | NUM = 19 | POSTFIX = % | FORMAT = BI}} |- | {{User:Tumbolisu/Sandbox | NUM = 19 | POSTFIX = % | FORMAT = BI | TOOLTIP=tooltip}} |}
Would generate:
Numbers | ||
---|---|---|
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
|