Skip to main content

Class: NumberFormatter

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

Static Readonly DEFAULT_OPTIONS: Readonly<Required<NumberFormatterOptions>>

Defined in

src/sdk/graphics/text/NumberFormatter.ts:72

Methods

create

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

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

NameTypeDescription
options?NumberFormatterOptionsOptions with which to customize the formatter.

Returns

fn

A function which formats numeric values to strings.

▸ (number): string

Parameters
NameType
numbernumber
Returns

string

Defined in

src/sdk/graphics/text/NumberFormatter.ts:225