numfmt

August 28, 2026 · View on GitHub

numfmt

The numfmt library formats numbers according to a specifier string as defined in ECMA-376. The library tries its best to emulate the inns and outs of what the Excel spreadsheet software does.

Type Aliases

Functions

addLocale()

function addLocale(localeSettings: Partial<LocaleData>, l4e: string | LocaleToken): LocaleData;

Register locale data for a language to use when formatting.

Any partial set of properties may be provided to have the defaults used where properties are missing.

Parameters

ParameterTypeDescription
localeSettingsPartial<LocaleData>A collection of settings for a locale.
l4estring | LocaleTokenA string BCP 47 tag of the locale.

Returns

LocaleData

A full collection of settings for a locale

dateFromSerial()

function dateFromSerial(serialDate: number, options?: {
  leap1900?: boolean;
}): [number, number, number, number, number, number];

Convert a spreadsheet serial date to an array of date parts. Accurate to a second.

// output as [ Y, M, D, h, m, s ]
dateFromSerial(28627); // [ 1978, 5, 17, 0, 0, 0 ]

Parameters

ParameterTypeDescription
serialDatenumberThe date
options?{ leap1900?: boolean; }Options for this method
options.leap1900?booleanSimulate the Lotus 1-2-3 1900 leap year bug. True by default.

Returns

[number, number, number, number, number, number]

An array of date parts with parts in descending order: [ year, month, day, hour, minute, second ]

dateToSerial()

function dateToSerial(date: number[] | Date, options?: {
  ignoreTimezone?: boolean;
}): number | undefined;

Convert a native JavaScript Date, or an array of date parts to an spreadsheet serial date.

Returns a serial date number if input was a Date object or an array of numbers, else an undefined.

// input as Date
dateToSerial(new Date(1978, 5, 17)); // 28627
// input as [ Y, M, D, h, m, s ]
dateToSerial([ 1978, 5, 17 ]); // 28627
// other input
dateToSerial("something else"); // undefined

Parameters

ParameterTypeDescription
datenumber[] | DateA Date instance or an array of date parts in descending order.
options?{ ignoreTimezone?: boolean; }Options for this method
options.ignoreTimezone?booleanNormally time zone will be taken into account. This makes the conversion to serial date ignore the timezone offset.

Returns

number | undefined

The date as a spreadsheet serial date, or undefined.

dec2frac()

function dec2frac(
   number: number, 
   numeratorMaxDigits?: number, 
   denominatorMaxDigits?: number): [number, number];

Split a fractional number into a numerator and denominator for display as vulgar fractions.

Parameters

ParameterTypeDefault valueDescription
numbernumberundefinedThe value to split
numeratorMaxDigits?number2Maximum digits the numerator may have.
denominatorMaxDigits?number2Maximum digits the denominator may have.

Returns

[number, number]

Tuple of two numbers, numerator and denominator.

format()

function format(
   pattern: string, 
   value: any, 
   options?: Partial<FormatOptions>): string;

Formats a value as a string and returns the result.

  • Dates are normalized to spreadsheet style serial dates and then formatted.
  • Booleans are emitted as uppercase TRUE or FALSE by default, but will be subject to locale (see LocaleData).
  • null and undefined will return an empty string "".
  • Any non number values will be stringified and passed through the text section of the format pattern.
  • NaNs and Infinites will use the corresponding strings from the active locale.

Parameters

ParameterTypeDescription
patternstringA format pattern in the ECMA-376 number format.
valueanyThe value to format.
options?Partial<FormatOptions>Formatter options

Returns

string

A formatted value

formatColor()

function formatColor(
   pattern: string, 
   value: any, 
   options?: {
  ignoreTimezone?: boolean;
  indexColors?: boolean;
  throws?: boolean;
}): string | number | undefined;

Find the color appropriate to a value as dictated by a format pattern.

If the pattern defines colors, this function will emit the color appropriate to the value. If no colors were specified this function returns undefined.

const color = formatColor("[green]#,##0;[red]-#,##0", -10);
console.log(color); // "red"
const color = formatColor("[green]#,##0;-#,##0", -10);
console.log(color); // undefined

Parameters

ParameterTypeDescription
patternstringA format pattern in the ECMA-376 number format.
valueanyThe value to format.
options?{ ignoreTimezone?: boolean; indexColors?: boolean; throws?: boolean; }Formatter options
options.ignoreTimezone?booleanNormally when date objects are used with the formatter, time zone is taken into account. This makes the formatter ignore the timezone offset. false by default.
options.indexColors?booleanWhen indexed color modifiers are used ([Color 1]) the formatter will convert the index into the corresponding hex color of the default palette. When this option is set to false, the number will instead by emitted allowing you to index against a custom palette. true by default.
options.throws?booleanShould the formatter throw an error if a provided pattern is invalid. If false, a formatter will be constructed which instead outputs an error string (see invalid in FormatOptions). true by default.

Returns

string | number | undefined

A string color value as described by the pattern or a number if the indexColors option has been set to false.

getFormatDateInfo()

function getFormatDateInfo(pattern: string): FormatDateInfo;

Gets information about how date codes are used in a format string.

Note that output will always be a format info, even in the case where the format pattern is invalid and would cause the formatter to throw.

Parameters

ParameterTypeDescription
patternstringA format pattern in the ECMA-376 number format.

Returns

FormatDateInfo

An object of format date properties.

getFormatInfo()

function getFormatInfo(pattern: string, options?: {
  currency?: string;
}): FormatInfo;

Returns an object detailing the properties and internals of a format parsed format pattern.

Note that output will always be a format info, even in the case where the format pattern is invalid and would cause the formatter to throw.

Parameters

ParameterTypeDescription
patternstringA format pattern in the ECMA-376 number format.
options?{ currency?: string; }Options for the method
options.currency?stringLimit the patterns identified as currency to those that use the give string. If nothing is provided, patterns will be tagged as currency if one of the following currency symbols is used: ¤$£¥֏؋৳฿៛₡₦₩₪₫€₭₮₱₲₴₸₹₺₼₽₾₿

Returns

FormatInfo

An object of format properties.

getLocale()

function getLocale(locale: string | number): LocaleData | undefined;

Used by the formatter to pull a locate from its registered locales. If subtag isn't available but the base language is, the base language is used: So if en-CA is not found, the formatter tries to find en else it returns undefined.

Parameters

ParameterTypeDescription
localestring | numberA BCP 47 string tag of the locale, or an Excel locale code.

Returns

LocaleData | undefined

An object of locale properties if one was found.

Throws

If the locale tag is invalid.

isDateFormat()

function isDateFormat(pattern: string): boolean;

Determine if a given format pattern is a date pattern.

The pattern is considered a date pattern if any of its sections ("a;b;c;d") contains a date operator (such as Y or H). Each section is restricted to be either a number or date format.

Parameters

ParameterTypeDescription
patternstringA format pattern in the ECMA-376 number format.

Returns

boolean

True if the specified pattern is a date pattern, False otherwise.

isPercentFormat()

function isPercentFormat(pattern: string): boolean;

Determine if a given format pattern is a percentage pattern.

The pattern is considered a percentage pattern if any of its sections ("a;b;c;d") contains an unescaped percentage symbol.

Parameters

ParameterTypeDescription
patternstringA format pattern in the ECMA-376 number format.

Returns

boolean

True if the specified pattern is a percent pattern, False otherwise.

isTextFormat()

function isTextFormat(pattern: string): boolean;

Determine if a given format pattern is a text only pattern.

The pattern is considered text only if its definition is composed of a single section that includes that text symbol (@).

For example @ or @" USD" are text patterns but #;@ is not.

Parameters

ParameterTypeDescription
patternstringA format pattern in the ECMA-376 number format.

Returns

boolean

True if the specified pattern is a text pattern, False otherwise.

isValidFormat()

function isValidFormat(pattern: string): boolean;

Determine if a given format pattern is valid.

Parameters

ParameterTypeDescription
patternstringA format pattern in the ECMA-376 number format.

Returns

boolean

True if the specified pattern is valid, False otherwise.

listLocales()

function listLocales(): string[];

Get a list of locales that are registered with the formatter.

Returns

string[]

A list of locale tags

parseBool()

function parseBool(value: string, options?: {
  locale?: string;
}): ParseDataBool | undefined;

Parse a string input and return its equivalent boolean value. If the input was not recognized or valid, the function returns an undefined, for valid input it returns an object with a single property:

  • v: the parsed value.

Parameters

ParameterTypeDescription
valuestringThe supposed boolean to parse
options?{ locale?: string; }Options for the parser
options.locale?stringA BCP 47 string tag. Locale default is english with a \u00a0 grouping symbol (see addLocale)

Returns

ParseDataBool | undefined

An object of the parsed value

parseDate()

function parseDate(value: string, options?: {
  locale?: string;
}): ParseDataNum | undefined;

Parse a date or datetime string input and return its value and format. If the input was not recognized or valid, the function returns an undefined, for valid input it returns an object with two properties:

  • v: the parsed value.
  • z: the number format of the input (if applicable).

Parameters

ParameterTypeDescription
valuestringThe string to parse
options?{ locale?: string; }Options for the parser
options.locale?stringA BCP 47 string tag. Locale default is english with a \u00a0 grouping symbol (see addLocale)

Returns

ParseDataNum | undefined

An object of the parsed value and a corresponding format string

parseLocale()

function parseLocale(locale: string): LocaleToken;

Parse a regular IETF BCP 47 locale tag (en-US) and emit an object of its parts. Irregular tags and subtags are not supported.

Parameters

ParameterTypeDescription
localestringA BCP 47 string tag of the locale.

Returns

LocaleToken

An object describing the locale.

Throws

If the locale tag is invalid.

parseNumber()

function parseNumber(value: string, options?: {
  locale?: string;
}): ParseDataNum | undefined;

Parse a numeric string input and return its value and format. If the input was not recognized or valid, the function returns an undefined, for valid input it returns an object with two properties:

  • v: the parsed value.
  • z: the number format of the input (if applicable).

Parameters

ParameterTypeDescription
valuestringThe number to parse
options?{ locale?: string; }Options for the parser
options.locale?stringA BCP 47 string tag. Locale default is english with a \u00a0 grouping symbol (see addLocale)

Returns

ParseDataNum | undefined

An object of the parsed value and a corresponding format string

parseTime()

function parseTime(value: string, options?: {
  locale?: string;
}): ParseDataNum | undefined;

Parse a time string input and return its value and format. If the input was not recognized or valid, the function returns an undefined, for valid input it returns an object with two properties:

  • v: the parsed value.
  • z: the number format of the input (if applicable).

Parameters

ParameterTypeDescription
valuestringThe string to parse
options?{ locale?: string; }Options for the parser
options.locale?stringA BCP 47 string tag. Locale default is english with a \u00a0 grouping symbol (see addLocale)

Returns

ParseDataNum | undefined

An object of the parsed value and a corresponding format string

parseValue()

function parseValue(value: string, options?: {
  locale?: string;
}): 
  | ParseDataNum
  | ParseDataBool
  | undefined;

Attempt to parse a "spreadsheet input" string input and return its value and format. If the input was not recognized or valid, the function returns an undefined, for valid input it returns an object with two properties:

  • v: The parsed value. For dates, this will be an Excel style serial date.
  • z: (Optionally) the number format string of the input. This property will not be present if it amounts to the General format.

parseValue() recognizes a wide range of dates and date-times, times, numbers, and booleans. Some examples:

// basic number
parseValue("-123");// { v: -123 }
// formatted number
parseValue("\$1,234"); // { v: 1234, z: "$#,##0" }
// a percent
parseValue("12.3%"); // { v: 0.123, z: "0.00%" }
// a date
parseValue("07 October 1984"); // { v: 30962, z: 'dd mmmm yyyy' }
// an ISO formatted date-time
parseValue("1984-09-10 11:12:13.1234"); // { v: 30935.46681855787, z: "yyyy-mm-dd hh:mm:ss" }
// a boolean
parseValue("false"); // { v: false }

The formatting string outputted may not correspond exactly to the input. Rather, is it composed of certain elements which the input controls. This is comparable to how Microsoft Excel and Google Sheets parse pasted input. Some things you may expect:

  • Whitespace is ignored.
  • Decimal fractions are always represented by .00 regardless of how many digits were shown in the input.
  • Negatives denoted by parentheses [(1,234)] will not include the parentheses in the format string (the value will still be negative.)
  • All "scientific notation" returns the same format: 0.00E+00.

Internally the parser calls, parseNumber, parseDate, parseTime and parseBool. They work in the same way except with a more limited scope. You may prefer those functions if you are limiting input to a smaller scope.

Parameters

ParameterTypeDescription
valuestringThe value to parse
options?{ locale?: string; }Options for the parser
options.locale?stringA BCP 47 string tag. Locale default is english with a \u00a0 grouping symbol (see addLocale)

Returns

| ParseDataNum | ParseDataBool | undefined

An object of the parsed value and a corresponding format string

round()

function round(number: number, places?: number): number;

Return a number rounded to the specified amount of places. This is the rounding function used internally by the formatter (symmetric arithmetic rounding). It rounds the same way Excel does.

Parameters

ParameterTypeDefault valueDescription
numbernumberundefinedThe number to round.
places?number0The number of decimals to round to.

Returns

number

A rounded number.

tokenize()

function tokenize(pattern: string): Token[];

Breaks a format pattern string into a list of tokens.

The returned output will be an array of objects representing the tokens:

[
  { type: TOKEN_ZERO, value: '0', raw: '0' },
  { type: TOKEN_POINT, value: '.', raw: '.' },
  { type: TOKEN_ZERO, value: '0', raw: '0' },
  { type: TOKEN_PERCENT, value: '%', raw: '%' }
]

Parameters

ParameterTypeDescription
patternstringThe format pattern

Returns

Token[]

A list of tokens

DayNames

type DayNames = [string, string, string, string, string, string, string];

A list of the names of the days of the week, starting with Sunday.

FormatDateInfo

type FormatDateInfo = {
  clockType: 12 | 24;
  day: boolean;
  hours: boolean;
  minutes: boolean;
  month: boolean;
  seconds: boolean;
  year: boolean;
};

An object detailing which date specifiers are used in a format pattern. See the getFormatDateInfo method.

Properties

PropertyTypeDescription
clockType12 | 2412 if the pattern uses AM/PM clock else 24.
daybooleantrue if the pattern uses day of the month else false.
hoursbooleantrue if the pattern uses hours else false.
minutesbooleantrue if the pattern uses minutes else false.
monthbooleantrue if the pattern uses months else false.
secondsbooleantrue if the pattern uses seconds else false.
yearbooleantrue if the pattern uses years else false.

FormatInfo

type FormatInfo = {
  code: string;
  color: 0 | 1;
  grouped: 0 | 1;
  isDate: boolean;
  isPercent: boolean;
  isText: boolean;
  level: number;
  maxDecimals: number;
  parentheses: 0 | 1;
  scale: number;
  type:   | "currency"
     | "date"
     | "datetime"
     | "error"
     | "fraction"
     | "general"
     | "grouped"
     | "number"
     | "percent"
     | "scientific"
     | "text"
     | "time";
};

An object of information properties based on a format pattern. See the getFormatInfo method.

Properties

PropertyTypeDescription
codestringCorresponds to Excel's CELL("format") functionality. It should match Excel's esoteric behaviour fairly well. See Microsoft's documentation.
color0 | 11 if the format uses color on the negative portion of the string, else a 0. This replicates Excel's CELL("color") functionality.
grouped0 | 11 if the positive portion of the format uses a thousands separator, else a 0.
isDatebooleanCorresponds to the output from isDateFormat.
isPercentbooleanCorresponds to the output from isPercentFormat.
isTextbooleanCorresponds to the output from isTextFormat.
levelnumberAn arbirarty number that represents the format's specificity if you want to compare one to another. Integer comparisons roughly match Excel's resolutions when it determines which format wins out.
maxDecimalsnumberThe maximum number of decimals this format will emit.
parentheses0 | 11 if the positive portion of the number format contains an open parenthesis, else a 0. This is replicates Excel's CELL("parentheses") functionality.
scalenumberThe multiplier used when formatting the number (100 for percentages).
type| "currency" | "date" | "datetime" | "error" | "fraction" | "general" | "grouped" | "number" | "percent" | "scientific" | "text" | "time"A string identifier for the type of the number formatter.

FormatOptions

type FormatOptions = {
  bigintErrorNumber: boolean;
  dateErrorNumber: boolean;
  dateErrorThrows: boolean;
  dateSpanLarge: boolean;
  fillChar: string;
  grouping: [number, number] | [number];
  ignoreTimezone: boolean;
  indexColors: boolean;
  invalid: string;
  leap1900: boolean;
  locale: string | number;
  nbsp: boolean;
  overflow: string;
  skipChar: string;
  throws: boolean;
};

Options that control the behavior of the formatter.

Properties

PropertyTypeDescription
bigintErrorNumberbooleanShould the formatter switch to a plain string number format when trying to format a bigint that is out of bounds of regular JS numbers? Default false
dateErrorNumberbooleanShould the formatter emit a number when trying to format a date that is out of bounds? This is default behaviour by Google Sheets. dateErrorThrows overrides this setting. Default true
dateErrorThrowsbooleanShould the formatter throw an error when trying to format a date that is out of bounds? Default false
dateSpanLargebooleanExtends the allowed range of dates from Excel bounds (1900–9999) to Google Sheet bounds (0–99999). Default true
fillCharstringWhen the formatter encounters * it normally emits nothing instead of the * and the next character (like Excel TEXT function does). Setting this to a character will make the formatter emit that followed by the next one. Default ''
grouping[number, number] | [number]Integer grouping sizes. You may desire to emit numbers in standards other than the common 3 digits per group (e.g. "123,456,789"). The first grouping size is used for the least significant integer group, and the second grouping size is used for more significant groups (e.g. [3, 2] => "12,34,56,789"). Default [ 3, 3 ]
ignoreTimezonebooleanNormally when date objects are used with the formatter, time zone is taken into account and the date is adjusted into UTC. This option makes the formatter ignore the timezone offset. Default false
indexColorsbooleanAutomatically resolve indexed colors to hex when outputting colors (red => #f00); When indexed color modifiers are used ([Color 1]) the formatter will convert the index into the corresponding hex color of the default palette. When this option is set to false, the number will instead by emitted allowing you to index against a custom palette. Default true
invalidstringThe string emitted when formatter fails to parse a pattern and has been instructed not to throw an error. Default '######'
leap1900booleanSimulate the Lotus 1-2-3 1900 leap year bug. It is a requirement in the Ecma OOXML specification so it is on by default. Default true
localestring | numberA BCP 47 string tag or Excel MsoLanguageID. Locale default is english with a \u00a0 grouping symbol (see addLocale) Default ''
nbspbooleanEmit regular vs. non-breaking spaces. By default the output will use a regular space, but in many cases you may desire a non-breaking-space instead. Default false
overflowstringThe string emitted when a formatter fails to format a date that is out of bounds. Both dateErrorThrows and dateErrorNumber override this setting. Default '######'
skipCharstringWhen the formatter encounters _ it normally emits a single space instead of the _ and the next character (like Excel TEXT function does). Setting this to a character will make the formatter emit that followed by the next one. Default ''
throwsbooleanShould the formatter throw an error if a provided pattern is invalid. If false, a formatter will be constructed which instead outputs an error string (see invalid in this type). Default true

LocaleData

type LocaleData = {
  ampm: [string, string];
  bool: [string, string];
  ddd: DayNames;
  dddd: DayNames;
  decimal: string;
  exponent: string;
  group: string;
  infinity: string;
  mmm: MonthNames;
  mmm6: MonthNames;
  mmmm: MonthNames;
  mmmm6: MonthNames;
  nan: string;
  negative: string;
  percent: string;
  positive: string;
  preferMDY: boolean;
};

An object of properties used by a formatter when printing a number in a certain locale.

Properties

PropertyTypeDescription
ampm[string, string]How AM and PM should be presented. Default ["AM", "PM"]
bool[string, string]How TRUE and FALSE should be presented. Default ["TRUE", "FALSE"]
dddDayNamesShortened day names (Wed). Default ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
ddddDayNamesLong day names (Wednesday). Default ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
decimalstringSymbol used to separate integers from fractions (usually .). Default "."
exponentstringSymbol used to indicate an exponent (usually E). Default "E"
groupstringSymbol used as a grouping separator (1,000,000 uses ,). Default "\u00a0"
infinitystringSymbol used to indicate infinite values (). Default "∞"
mmmMonthNamesShort month names for the Gregorian calendar (Nov). Default ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
mmm6MonthNamesShort month names for the Islamic calendar (Raj.). Default ["Muh.", "Saf.", "Rab. I", "Rab. II", "Jum. I", "Jum. II", "Raj.", "Sha.", "Ram.", "Shaw.", "Dhuʻl-Q.", "Dhuʻl-H."]
mmmmMonthNamesLong month names for the Gregorian calendar (November). Default ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
mmmm6MonthNamesLong month names for the Islamic calendar (Rajab). Default ["Muharram", "Safar", "Rabiʻ I", "Rabiʻ II", "Jumada I", "Jumada II", "Rajab", "Shaʻban", "Ramadan", "Shawwal", "Dhuʻl-Qiʻdah", "Dhuʻl-Hijjah"]
nanstringSymbol used to indicate NaN values (NaN). Default "NaN"
negativestringSymbol used to indicate positive numbers (usually -). Default "-"
percentstringSymbol used to indicate a percentage (usually %). Default "%"
positivestringSymbol used to indicate positive numbers (usually +). Default "+"
preferMDYbooleanIs the prefered date format month first (12/31/2025) or day first (31/12/2025). Default false

LocaleToken

type LocaleToken = {
  lang: string;
  language: string;
  territory: string;
};

An object of properties for a locale tag.

{ lang: 'zh-CN', language: 'zh', territory: 'CN' }

Properties

PropertyTypeDescription
langstringThe basic tag such as zh-CN or fi
languagestringThe language section (zh for zh-CN)
territorystringThe territory section (CN for zh-CN)

MonthNames

type MonthNames = [string, string, string, string, string, string, string, string, string, string, string, string];

A list of the names of the months of the year.

ParseDataBool

type ParseDataBool = {
  v: boolean;
  z?: never;
};

Output from the boolean value parser.

Properties

PropertyTypeDescription
vbooleanA boolean value
z?neverA number format pattern

ParseDataNum

type ParseDataNum = {
  v: number;
  z?: string;
};

Output from a number or date value parser.

Properties

PropertyTypeDescription
vnumberA number value
z?stringA number format pattern

Token

type Token = {
  raw: string;
  type: TokenType;
  value: string;
};

A token emitted by the tokenizer.

Properties

PropertyTypeDescription
rawstringRaw token source.
typeTokenTypeToken type.
valuestringThe value of the token, cleaned of extra characters.

TokenType

type TokenType = 
  | typeof TOKEN_GENERAL
  | typeof TOKEN_HASH
  | typeof TOKEN_ZERO
  | typeof TOKEN_QMARK
  | typeof TOKEN_SLASH
  | typeof TOKEN_GROUP
  | typeof TOKEN_SCALE
  | typeof TOKEN_COMMA
  | typeof TOKEN_BREAK
  | typeof TOKEN_TEXT
  | typeof TOKEN_PLUS
  | typeof TOKEN_MINUS
  | typeof TOKEN_POINT
  | typeof TOKEN_SPACE
  | typeof TOKEN_PERCENT
  | typeof TOKEN_DIGIT
  | typeof TOKEN_CALENDAR
  | typeof TOKEN_ERROR
  | typeof TOKEN_DATETIME
  | typeof TOKEN_DURATION
  | typeof TOKEN_CONDITION
  | typeof TOKEN_DBNUM
  | typeof TOKEN_NATNUM
  | typeof TOKEN_LOCALE
  | typeof TOKEN_COLOR
  | typeof TOKEN_MODIFIER
  | typeof TOKEN_AMPM
  | typeof TOKEN_ESCAPED
  | typeof TOKEN_STRING
  | typeof TOKEN_SKIP
  | typeof TOKEN_EXP
  | typeof TOKEN_FILL
  | typeof TOKEN_PAREN
  | typeof TOKEN_CHAR;

A valid token type.

Token typeDescription
TOKEN_AMPMAM/PM operator (AM/PM, A/P)
TOKEN_BREAKSemicolon operator indicating a break between format sections (;)
TOKEN_CALENDARCalendar modifier (B2)
TOKEN_CHARSingle non-operator character (m)
TOKEN_COLORColor modifier ([Black], [color 5])
TOKEN_COMMAPlain non-operator comma (,)
TOKEN_CONDITIONCondition modifier for a section ([>=10])
TOKEN_DATETIMEDate-time operator (mmmm, YY)
TOKEN_DBNUMNumber display modifier ([DBNum23])
TOKEN_DIGITA digit between 1 and 9 (3)
TOKEN_DURATIONTime duration ([ss])
TOKEN_ERRORUnidentifiable or illegal character (Ň)
TOKEN_ESCAPEDEscaped character (\E)
TOKEN_EXPExponent operator (E+)
TOKEN_FILLFill with char operator and operand (*_)
TOKEN_GENERALGeneral format operator (General)
TOKEN_GROUPNumber grouping operator (,)
TOKEN_HASHHash operator (digit if available) (#)
TOKEN_LOCALELocale modifier ([$-1E020404])
TOKEN_MINUSMinus sign (-)
TOKEN_MODIFIERAn unidentified modifier ([Lorem])
TOKEN_NATNUMNumber display modifier ([NatNum3])
TOKEN_PARENParenthesis character ())
TOKEN_PERCENTPercent operator (%)
TOKEN_PLUSPlus sign (+)
TOKEN_POINTDecimal point operator (.)
TOKEN_QMARKQuestion mark operator (digit or space if not available) (?)
TOKEN_SCALEScaling operator (,)
TOKEN_SKIPSkip with char operator and operand (*_)
TOKEN_SLASHSlash operator (/)
TOKEN_SPACESpace ( )
TOKEN_STRINGQuoted string ("days")
TOKEN_TEXTText output operator (@)
TOKEN_ZEROZero operator (digit or zero if not available) (0) *