Defines rules and symbols for formatting non-monetary numeric information.
The LC_NUMERIC category of a locale definition source file defines rules and symbols for formatting non-monetary numeric information. This category begins with an LC_NUMERIC category header and terminates with an END LC_NUMERIC category trailer.
All operands for the LC_NUMERIC 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_NUMERIC category:
Item | Description |
---|---|
copy | The copy statement 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. |
decimal_point | Specifies the string used for the decimal delimiter used to format numeric, non-monetary quantities. |
thousands_sep | Specifies the string separator used for grouping digits to the left of the decimal delimiter in formatted numeric, non-monetary quantities. |
grouping | Defines the size of each group of digits in formatted monetary quantities. The operand for the 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 used repeatedly 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 grouping statement. Assuming the value to be formatted is 123456789 and the operand for the thousands_sep keyword is ' (single quotation mark) the following results occur:
Grouping Value | Formatted Value |
---|---|
3;-1 | 123456'789 |
3 | 123'456'789 |
3;2;-1 | 1234'56'789 |
3;2 | 12'34'56'789 |
-1 | 123456789 |
Following is an example of a possible LC_NUMERIC category listed in a locale definition source file:
LC_NUMERIC
#
decimal_point "<period>"
thousands_sep "<comma>"
grouping <3>
#
END LC_NUMERIC
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. |