Formatting field values

You can format field values in record layouts or in the message Field Editor.

On the Formatting page, select Enable Formatting to apply formatting options to the field.

The options on the Configuration page vary according to the value of the Category field. See the Configuration page section in this topic. Options on the Alignment page are the same for all categories. See the Alignment page section in this topic.

For the Field Editor only (not for Record Layouts), you can preview the formatted value of the field in the Sample field. If the field value contains a tag, click Tag Value, enter a temporary value for any of the displayed user-defined tags, and click Refresh. The Sample field is updated. You cannot enter a temporary value for a system tag.

Configuration page

The following configuration options are available:

Table 1. Configuration page options by category
Category Description
Date Time The following options are available:
Use Current® Date and Time
If this option is selected, the Input Format field is completed automatically. The value to be formatted is the current date and time, and not the value in the message field.
Input Format
The date to be read can be either year first or month first.
Output Format
The date to be displayed can be either year first or month first.
String The java.util.Formatter class is used to format the string. To not use the default string format, select Custom and provide a regular expression to be used while formatting the string.
Number The following options are available:
Decimal Places
The number of decimal places in the formatted number.
Use 1000 separator
The separator to be used is locale-dependent.
Custom
To use specialized numerical format, such as parentheses for negative amounts, select Custom checkbox and replace the default format with the custom format. Click Summary for a short list of Decimal Format characters.
Currency The following options are available:
Decimal Places
The number of decimal places in the formatted number.
Symbol
The currency symbol that must precede the formatted number.
Custom
To use a specialized numerical format, such as parentheses for negative amounts, select Custom checkbox and replace the default format with the custom format. Click Summary for a short list of Decimal Format characters.
Symbol
The currency symbol that must precede the formatted number.
Custom The following options are available:
Enable
To specify a custom Java archive (.jar) file to use in formatting the field.
Jar name
The name of the archive file to use. You can use a tag as part of the pathname, such as %%PROJECT/ROOT%%.
Class name
Click Browse Classes to see the available classes in the archive. The classes that can be successfully used are the ones that extend the com.ghc.fieldactions.formatting.CustomFormat interface, which is available by compiling against the com.ghc.a3 plug-in archive.
Parameters
After you identify the Class name, you can edit the parameters that the custom format uses.

Alignment page

All the different field categories have the same options on the Alignment page:

Table 2. Alignment page options
Option Header
Length Choose one of the following:
None
No minimum length for the field.
Custom
Specify a minimum length in characters. If the content of the field is shorter than the specified minimum length, the length by character specified in the Character field is used to pad the content. If the Trim if too long option is selected, this value is also used as the maximum length for the field, and additional characters are discarded.
Justification Choose the justification option for the field.
Character Specify the character to be used for padding. Different characters are available for left and right padding, depending on the value of the Justification field. Both Left and Right fields contain a space by default, and you must delete the space before you can add a different character.
Trim if too long If you select this option, the value of the Length option is used for both maximum and minimum length for the content of the field.