FORMAT in JS

Description

There are different functions to format date and integer values in JavaScript. Unfortunately, these functionalities are not integrated into one method.

DateTime values

Syntax

Intl.DateTimeFormat( format ).format( value )

Arguments

locales (Optional): String expression of the format to apply.

options (Optional): Object with different supported properties for formats of numeric expressions (JavaScript NumberFormat function Documentation).

value: Numeric expression to format.

Return Type

String.

Numeric values

Syntax

Arguments

locales (Optional): String expression of the format to apply.

options (Optional): Object with different supported properties for formats of numeric expressions (JavaScript NumberFormat function Documentation).

value: Numeric expression to format.

Return Type

String.

Examples

DateTime

Numeric

Last updated