Difference between revisions of "Template:Decimal Align/doc"
m (Added decimal seperator) |
|||
Line 38: | Line 38: | ||
| {{Decimal Align | NUM = 123}} | | {{Decimal Align | NUM = 123}} | ||
|- | |- | ||
− | | {{Decimal Align | NUM = 999.111 | P = 2}} | + | | {{Decimal Align | NUM = 999.111 | P = 2 | SEP = ,}} |
|} | |} |
Revision as of 07:16, 8 July 2010
This template is useful for stacking values in a table, where the numbers should be aligned based on the decimal separator. This template takes two arguments:
Argument | Meaning |
---|---|
NUM | Number to format |
P | Number of places after the decimal separator, defaults to three, maximum of nine |
SEP | Alternate character to use as the decimal separator, defaults to a .
|
So in example, the following table construct:
{| class="wikitable grid" |- ! class = "header" | Numbers |- | {{Decimal Align | NUM = 123.456789}} |- | {{Decimal Align | NUM = 123.456789 | P = 0}} |- | {{Decimal Align | NUM = 123}} |- | {{Decimal Align | NUM = 999.111 | P = 2 | SEP = ,}} |}
Would generate:
Numbers | ||
---|---|---|
| ||
| ||
| ||
|