Skip to main content

Class: NumberFormatter

Defined in: src/sdk/graphics/text/NumberFormatter.ts:108

A utility class for creating number formatters.

Each number formatter is a function which generates output strings from input numeric values. The formatting behavior of a formatter is defined by its options. Please refer to the NumberFormatterOptions type documentation for more information on each individual option.

Constructors

Constructor

new NumberFormatter(): NumberFormatter

Returns

NumberFormatter

Properties

DEFAULT_OPTIONS

readonly static DEFAULT_OPTIONS: Readonly<Required<NumberFormatterOptions>>

Defined in: src/sdk/graphics/text/NumberFormatter.ts:109

Methods

create()

static create(options?): (number) => string

Defined in: src/sdk/graphics/text/NumberFormatter.ts:335

Creates a function which formats numeric values to strings. The formatting behavior of the function can be customized using a number of options. Please refer to the NumberFormatterOptions type documentation for more information on each individual option.

Parameters

ParameterTypeDescription
options?NumberFormatterOptionsOptions with which to customize the formatter.

Returns

A function which formats numeric values to strings.

(number): string

Parameters
ParameterType
numbernumber
Returns

string