# Number Parser (/placeholders/parsers/number)



## Usage [#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 [#examples]

1. Thousands separators (default):

* Input: `{number:{guild.memberCount}}`
* Output: `10,000`

2. Compact form, for cards and buttons:

* Input: `{number(compact):{guild.memberCount}}`
* Output: `10K`

3. Plain, with any separators stripped:

* Input: `{number(plain):10,000}`
* Output: `10000`

4. Around another parser:

* Input: `{number:{math:250*12}}`
* Output: `3,000`

## Available Parameters [#available-parameters]

| Parameter | Description                                     | Default | Example |
| --------- | ----------------------------------------------- | ------- | ------- |
| style     | How the number is written: "compact" or "plain" | grouped | compact |

## Notes [#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}`
