🎉 Tickety V3 has now been released! Read more →
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

  1. Thousands separators (default):
  • Input: {number:{guild.memberCount}}
  • Output: 10,000
  1. Compact form, for cards and buttons:
  • Input: {number(compact):{guild.memberCount}}
  • Output: 10K
  1. Plain, with any separators stripped:
  • Input: {number(plain):10,000}
  • Output: 10000
  1. Around another parser:
  • Input: {number:{math:250*12}}
  • Output: 3,000

Available Parameters

ParameterDescriptionDefaultExample
styleHow the number is written: "compact" or "plain"groupedcompact

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}

On this page