toString

Formats dates and numbers based on the specified format and locale.

Parameters

value

string | Date | number

The value that will be formatted.

format

string | any

A string that represents a predefined or custom date or number format, or a configuration object.

locale?

string

The optional locale id. If not specified, the id of the "en" locale is used.

Returns

string

  • The formatted value.

In this article

Not finding the help you need?