PlaceholdersParsers
Number Parser for Placeholders
Format numbers in Tickety placeholders for reading, with thousands separators or a shortened form, plus every available style, examples and notes.
Usage
To use the parser, insert the following syntax in your text:
{number(style):value}
- You can also reference this parser using the alias: num
Examples
- Thousands separators (default):
- Input:
{number:{guild.memberCount}} - Output:
10,000
- Compact form, for cards and buttons:
- Input:
{number(compact):{guild.memberCount}} - Output:
10K
- Plain, with any separators stripped:
- Input:
{number(plain):10,000} - Output:
10000
- Around another parser:
- Input:
{number:{math:250*12}} - Output:
3,000
Available Parameters
| Parameter | Description | Default | Example |
|---|---|---|---|
| style | How the number is written: "compact" or "plain" | grouped | compact |
Notes
- Grouped output keeps up to two decimal places, so an average rating stays readable
- Compact output keeps one decimal place, for example
1.2M - Separators already present in the value are ignored, so formatting a formatted number is safe
- A value that is not a number is left untouched, tag and all
- A value that resolves to nothing renders as nothing, which is what makes it safe to use with placeholders that are only set some of the time, such as
{milestone.count}
Padding Parser
Pad text in a Tickety placeholder to a fixed length with a character of your choice, on the left, the right or both sides, with every parameter and examples.
Math Parser
Do arithmetic in Tickety placeholders with operators, parentheses and precedence, and set fixed decimal places or integer truncation on the result.