Defines rules and symbols for formatting monetary numeric information.
The LC_MONETARY category of a locale definition source file defines rules and symbols for formatting monetary numeric information. This category begins with an LC_MONETARY category header and terminates with an END LC_MONETARY category trailer.
All operands for the LC_MONETARY category keywords are defined as string or integer values. String values are enclosed by " " (double-quotation marks). All values are separated from the keyword they define by one or more spaces. Two adjacent double-quotation marks indicate an undefined string value. A -1 indicates an undefined integer value. The following keywords are recognized in the LC_MONETARY category:
Item | Description |
---|---|
copy | Specifies the name of an existing locale to be used as the definition of this category. If a copy statement is included in the file, no other keyword can be specified. |
int_curr_symbol | Specifies the string used for the international currency symbol. The operand for the int_curr_symbol keyword is a four-character string. The first three characters contain the alphabetic international-currency symbol. The fourth character specifies a character separator between the international currency symbol and a monetary quantity. |
currency_symbol | Specifies the string used for the local currency symbol. |
mon_decimal_point | Specifies the string used for the decimal delimiter used to format monetary quantities. |
mon_thousands_sep | Specifies the character separator used for grouping digits to the left of the decimal delimiter in formatted monetary quantities. |
mon_grouping | Specifies a string that defines the size of each group of
digits in formatted monetary quantities. The operand for the mon_grouping keyword consists of a sequence of semicolon-separated integers.
Each integer specifies the number of digits in a group. The initial
integer defines the size of the group immediately to the left of the
decimal delimiter. The following integers define succeeding groups
to the left of the previous group. If the last integer is not -1,
the size of the previous group (if any) is repeatedly used for the
remainder of the digits. If the last integer is -1, no further grouping
is performed. The following is an example of the interpretation of the mon_grouping statement. Assuming the value to be formatted is 123456789 and the operand for the mon_thousands_sep keyword is ' (single-quotation mark), the following results occur: |
mon_grouping Value | Formatted Value |
---|---|
3;-1 | 123456'789 |
3 | 123'456'789 |
3;2;-1 | 1234'56'789 |
3;2 | 12'34'56'789
|
positive_sign | Specifies the string used to indicate a nonnegative-valued formatted monetary quantity. |
negative_sign | Specifies the string used to indicate a negative-valued formatted monetary quantity. |
int_frac_digits | Specifies an integer value representing the number of fractional digits (those after the decimal delimiter) to be displayed in a formatted monetary quantity using the int_curr_symbol value. |
frac_digits | Specifies an integer value representing the number of fractional digits (those after the decimal delimiter) to be displayed in a formatted monetary quantity using the currency_symbol value. |
p_cs_precedes | Specifies an integer value indicating whether the int_curr_symbol or currency_symbol string precedes or follows the value for
a nonnegative formatted monetary quantity. The following integer values
are recognized:
|
p_sep_by_space | Specifies an integer value indicating whether the int_curr_symbol or currency_symbol string is separated by a space from a
nonnegative formatted monetary quantity. The following integer values
are recognized:
|
n_cs_precedes | Specifies an integer value indicating whether the int_curr_symbol or currency_symbol string precedes or follows the value for
a negative formatted monetary quantity. The following integer values
are recognized:
|
n_sep_by_space | Specifies an integer value indicating whether the int_curr_symbol or currency_symbol string is separated by a space from a
negative formatted monetary quantity. The following integer values
are recognized:
|
p_sign_posn | Specifies an integer value indicating the positioning of
the positive_sign string for a nonnegative formatted monetary
quantity. The following integer values are recognized:
|
n_sign_posn | Specifies an integer value indicating the positioning of
the negative_sign string for a negative formatted monetary
quantity. The following integer values are recognized:
|
debit_sign | Specifies the string used for the debit symbol (DB) to indicate a nonnegative formatted monetary quantity. |
credit_sign | Specifies the string used for the credit symbol (CR) to indicate a negative formatted monetary quantity. |
left_parenthesis | Specifies the character, equivalent to a ( (left parenthesis), used by the p_sign_posn and n_sign_posn statements to enclose a monetary quantity and currency symbol. |
right_parenthesis | Specifies the character, equivalent to a ) (right parenthesis), used by the p_sign_posn and n_sign_posn statements to enclose a monetary quantity and currency symbol. |
A unique customized monetary format can be produced by changing the value of a single statement. For example, the following table shows the results of using all combinations of defined values for the p_cs_precedes, p_sep_by_space, and p_sign_posn statements.
Item | Description | |
---|---|---|
p_cs_precedes | p_sign_posn | p_sep_by_space = |
p_cs_precedes = 1 | p_sign_posn = 0 |
|
p_sign_posn = 1 |
|
|
p_sign_posn = 2 |
|
|
p_sign_posn = 3 |
|
|
p_sign_posn = 4 |
|
|
p_cs_precedes = 0 | p_sign_posn = 0 |
|
p_sign_posn = 1 |
|
|
p_sign_posn = 2 |
|
|
p_sign_posn = 3 |
|
|
p_sign_posn = 4 |
|
The following is an example of a possible LC_MONETARY category listed in a locale definition source file:
LC_MONETARY
#
int_curr_symbol "<U><S><D>"
currency_symbol "<dollar-sign>"
mon_decimal_point "<period>"
mon_thousands_sep "<comma>"
mon_grouping <3>
positive_sign "<plus-sign>"
negative_sign "<hyphen>"
int_frac_digits <2>
frac_digits <2>
p_cs_precedes <1>
p_sep_by_space <2>
n_cs_precedes <1>
n_sep_by_space <2>
p_sign_posn <3>
n_sign_posn <3>
debit_sign "<D><B>"
credit_sign "<C><R>"
left_parenthesis "<left-parenthesis>"
right_parenthesis "<right-parenthesis>"
#
END LC_MONETARY
Item | Description |
---|---|
/usr/lib/nls/loc/* | Specifies locale definition source files for supported locales. |
/usr/lib/nls/charmap/* | Specifies character set description (charmap) source files for supported locales. |