Format configuration

Syntax

	configuredFormat($id)

Description

Retrieves a format instance via its configuration ID and initializes it. This function enables access to preconfigured formatting defined in the Service Editor under "Format configurations" and can be used for parse() or format() calls.

Parameters

name Type Type Description Mandatory Default
id Character string The configuration ID of the format to be retrieved. yes

Return value

Type: Format

A format instance that can be used for parse() or format() calls. Throws an error message for invalid input, with references to available format definitions.

Examples

Use of a configured date format

	configuredFormat("short-date").format(date(2012, 11, 31))

Output: 31.12.12

Use of a configured currency format

	configuredFormat("euro").format(123456.5)

Output: 123,456.50 €

Parsing a formatted number

	configuredFormat("number").parse("1.234,56")

Output: 1,234.56