DBMONEY

Defines currency symbol and decimal separator for input and display of numeric values, when DBFORMAT is not defined.

The DBMONEY environment variable defines the currency symbol and the decimal separator for numeric values.
Important:
  • When defined, the DBFORMAT environment variable takes precedence over DBMONEY.
  • The DBMONEY environment variable is also used by the IBM® Informix® database client and server to make date to string conversions.
The value of a DBMONEY variable must use the following syntax:
front{.|,}back
  1. front is a character string representing a leading currency symbol that precedes the value.
  2. back is a character string representing a trailing currency symbol that follows the value.
If neither DBMONEY, nor DBFORMAT are defined, the default numeric formatting depends on the type of platform where the runtime system executes:

DBMONEY can only define the currency symbol and decimal separator characters must be specified in this environment variable. If you want to define the thousands separator, use the DBFORMAT environment variable instead. However, if only DBMONEY is used, an implicit thousands separator is selected.

The currency symbol in DBMONEY can be up to seven characters long and can contain any character except a comma or a period. It can be non-ASCII characters if the current locale supports a code set that defines the non-ASCII characters you use.

The DBMONEY environment variable can be set to define the input and display format for values of the following types:

Numeric values will be displayed in forms and reports according to this environment variable.

DBMONEY will also be used for implicit data conversion between numeric values and character strings.

The position of the currency symbol (relative to the decimal separator) indicates whether the currency symbol appears before or after the MONEY value. When the currency symbol is positioned in DBMONEY before the decimal separator, it is displayed before the value ($1234.56). When it is positioned after the decimal separator, it is displayed after the value (1234.56F).

The runtime system recognizes the period ( . ) and the comma ( , ) as decimal separators. All other characters are considered to be part of the currency symbol. For example, ", FR" defines a MONEY format with the comma as decimal separator and the string " FR" (including the space) as the currency symbol.

Because only its position within a DBMONEY setting indicates whether a symbol is the front or back currency symbol, the decimal separator is required. If you use DBMONEY to specify a back symbol, for example, you must supply a decimal separator (a comma or period). Similarly, if you use DBMONEY to change the decimal separator from a period to a comma, you must also supply a currency symbol.

To avoid ambiguity in displayed numbers and currency values, do not use the thousands separator of DBFORMAT as the decimal separator of DBMONEY. For example, specifying comma as the DBFORMAT thousands separator dictates using the period as the DBMONEY decimal separator.

When using a graphical front-end, the decimal separator of the numeric keypad will produce the character defined by this environment variable.