Number format

Syntax

	numberFormat($pattern)

Description

Constructs a number format with the given pattern for either parse() or format() calls.

See DecimalFormat.

Parameters

Name Type Description Mandatory Default
pattern String

The pattern in which to format. It is specified as follows:

  • 0 - a number, if present, otherwise 0
  • # - a number, if present, otherwise nothing
  • . - Specifies where to place the decimal separator.
  • , - specifies where the grouping separator should be placed
  • for other symbols see DecimalFormat
yes

Return value

Type: Business object

A number format that can now be used for parse() or format() calls.

Examples

Format with #

	numberFormat("###,###.###").format(123456.59874)

Output: 123.456,599

Format with # and 0

	numberFormat("###,###.000").format(123456.5)

Output: 123.456,500

Less characters

	numberFormat("###,###.###").format(123456.5)

Output: 123.456,5