You are here: Field Rules Reference > Field Rules Summary > FmtNum

FmtNum

Use this field level rule to format amounts for different localities. This rule supports overflow. The mask area takes these values:

An fetype defines the field format type. You can have an input and an output fetype. For example, an input fetype with the FmtNum rule tells the system where the decimal goes in the number. The output fetype tells the system how to format the output amount. An fetype can consist of either one or four characters.

The first character of an fetype defines the field format type. There are several types defined in the system such as a d for dates and an n for numbers. You can add three additional characters to override the default locale, which is USD (United States, English). See Field Format Types (fetypes) for a list of the supported localities. If your defined fetype is not one that is supported, the system uses USD.

Left justifying numbers

You can include the L parameter to left justify numbers after they have been formatted. This parameter is the fourth optional flag in the Mask field. For example, if you have this format mask

n,n,"z,zzz,zzz,zzz,zz9.99",L

and the extract data has an amount such as 123456.99, the system uses this rule to read the amount and formats this number to produce the result, 123,459.99. The rule will then left justify the field. Below is an example of the result with and without the L parameter.

Without the L parameter:

n,n,"z,zzz,zzz,zzz,zz9.99"

123,456.99

With the L parameter:

n,n,"z,zzz,zzz,zzz,zz9.99",l

123,456.99

Like the Move_It and MoveNum rules, this type of left justification simply removes leading spaces. It does not provide a positional justification as is provided by the JustFld rule.

See also