Formatting
Syntax
$format.format($value1,...)
Description
Formats the given objects in the specified format. If more than one value is given, the format is called with an array of these values as argument (useful for messageFormat()).
Parameters
Name | Type | Description | Mandatory | Default |
---|---|---|---|---|
format | Business object | The format to be used (e.g. Number format, Date format or Message format) | yes | |
value | Business object | The object to be formatted. | yes |
Return value
Type: String
A string representing the object in the given format.
Examples
Number format
numberFormat("###,###.###").format(123456.59874)
Output: 123.456,599
See Number format
Date format
dateFormat("dd-MM-yy").format(date(2012, 11, 5))
Output: 05-12-2012
See Date format
Message Format
messageFormat("Good {0}, {1}! Today we have {2} degrees.").format("Morning", "Sir", 19)
Output: Good Morning Sir! Today we have 19 degrees.
Multiple values for format() are supplied here so that they can all be inserted into the placeholders in MessageFormat. See Message format.