PlaceholdersParsers
Number Parser
The Number Parser formats numbers for reading, adding thousands separators or shortening them.
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
The Padding Parser allows you to add padding characters to strings to ensure they reach a specific length.
Math Parser
The Math Parser allows you to perform mathematical calculations and evaluate expressions with support for basic arithmetic operations, parentheses, and formatting options.