Number
Apply number formatting to the given number.
The Number counter turns a value into a number so that number formatting applies to it. On its own it changes nothing you can see. Its whole job is to make Use compact notation, Override default locale and Override default digits work on a value the bot would otherwise treat as text.
Availability: every bot type. It makes no network requests, so it needs no API key and no environment variable when you self-host.

Counters that return text even when the text looks like a number:
HTTP returns the value at your Data path. A quoted JSON field arrives as text; a bare JSON number already arrives as a number.
Reddit returns text when it is set to return the subreddit title; its member counts are already numbers.
Options
Number
The value to convert to a number.
One value only. Type a number into the box, or pick a counter from the same box to nest it.
The Number field takes a nested counter, which is the normal way to use this counter. The nested counter has to return a valid number.
What it returns
The value read as a number.
1234
1234
12 (with spaces around it)
12
1e3
1000
0x10
16
an empty string
0
1,234
not a number, the counter fails
$99
not a number, the counter fails
99.4%
not a number, the counter fails
the Number field left empty
not a number, the counter fails
An empty string quietly becomes 0 instead of failing, so a nested counter that sometimes returns nothing shows 0 rather than an error.
Number does not round. 42.857142857142854 stays 42.857142857142854, and Use compact notation is the only way to shorten a value.
Formatting
This is the point of the counter, so all of the Format settings apply: Use compact notation, Override default locale, and Override default digits, where you give each digit from 0 to 9 the character or emoji it is drawn with.
Override default locale only changes anything when Use compact notation is on. It picks the language the shortened form is written in.
Custom digits only reach text and announcement channel topics, never voice or category channel names, because Discord channel names cannot show them.
Refresh and caching
Number caches nothing. The bot works it out again on every channel update, every 10 minutes on the public bot and every 5 minutes on the other bot types. See How counters update.
Whatever you nest inside it keeps its own refresh behaviour, so an HTTP counter with a Lifetime (in seconds) of 300 still only refetches every five minutes.
Examples
The Bitcoin price comes back from the API as text, so on its own it can never be shortened. Nesting it in a Number counter fixes that.
Add an HTTP counter with URL (GET)
https://api.coinlore.net/api/ticker/?id=90, Data path[0].price_usdand Lifetime (in seconds)300.Add a Number counter and put the HTTP counter into its Number field, so Number is the outer counter.
Open Format settings on the Number counter and set Use compact notation to Yes.
The channel then shows the price shortened, such as 81K, instead of the full number. Leave compact notation off and you get the raw number exactly as it came in.

Custom digits are part of the number formatting, so the bot skips them for any counter that returns text. Put a Number counter around it, then turn on Override default digits in the outer counter's Format settings and set the character for each digit.
Remember that custom digits only show up in text and announcement channel topics.
Errors
The channel shows ERROR!
The template failed. Open the channel in the dashboard and read the error below.
Failed to generate a final string from the evaluation.
The value could not be read as a number. Refill the Number field, and clean commas, currency symbols or percent signs with a Replace counter nested inside it.
The result for the channel name is less than 2 characters long.
A voice or category channel name needs at least 2 characters. Add text around the counter in the template, for example Members: before it.
If it still fails, Troubleshooting covers the common causes, and you can ask on the support server.
Last updated