From: keld@dkuug.dk (Keld J|rn Simonsen) Date: Fri, 13 Mar 1998 00:49:19 +0100 Subject: (SC22WG15.1206) specifications for handling of the Euro Here is a description for handling the Euro, in response to the WG15 action item 9710-27 This is an extract of FCD 15652, that addresses the Euro. Reference number of working document: ISO/IEC JTC1/SC22/WG20 N553 Date: 1997-12-21 Reference number of document: ISO/IEC FCD 14652 Committee identification: ISO/IEC JTC1/SC22 Secretariat: ANSI Information technology - Specifications for Cultural Conventions Technologies de l'information - Spécifications des conventions culturelles 4.4 LC_MONETARY The LC_MONETARY category defines the rules and symbols that shall be used to format monetary numeric information. The operands are strings. For some keywords, the strings can contain only integers. Keywords that are not provided, string values set to the empty string "", or integer keywords set to -1, shall be used to indicate that the value is unspecified, and then no default is taken. The following keywords shall be defined: copy Specify the name of an existing FDCC-set to be used as the source for the definition of this category. If this keyword is specified, no other keyword shall be specified. int_curr_symbol The international currency symbol. The operand shall be a four character string, with the first three characters containing the alphabetic international currency symbol in accordance with those specified in ISO 4217 (Codes for the representation of currencies and funds). The fourth character shall be the character used to separate the international currency symbol from the monetary quantity. The keyword shall be specified, unless the "copy" keyword is used. currency_symbol The string that shall be used as the local currency symbol. mon_decimal_point The operand is a string containing the symbol that shall be used as the decimal delimiter in monetary formatted quantities. In contexts where other standards limit the mon_decimal_point to a single byte, the result of specifying a multibyte operand is unspecified. The keyword shall be specified, unless the "copy" keyword is used. mon_thousands_sep The operand is a string containing the symbol that shall be used as a separator for groups of digits to the left of the decimal delimiter in formatted monetary quantities. In contexts where other stan- dards limit the mon_thousands_sep to a single byte, the result of specifying a multibyte operand is unspecified. The keyword shall be specified, unless the "copy" keyword is used. mon_grouping Define the size of each group of digits in formatted monetary quantities. The operand is a sequence of integers separated by semicolons. Each integer specifies the number of digits in each group, with the initial integer defining the size of the group immediately preceding the decimal delimiter, and the following integers defining the preceding groups. If the last integer is not -1, then the size of the previous group (if any) shall be repeatedly used for the remainder of the digits. If the last integer is -1, then no further grouping shall be performed. The keyword shall be specified, unless the "copy" keyword is used. positive_sign A string that shall be used to indicate a nonnegative-valued formatted monetary quantity. The keyword shall be specified, unless the "copy" keyword is used. negative_sign A string that shall be used to indicate a negative-valued formatted monetary quantity. The keyword shall be specified, unless the "copy" keyword is used. int_frac_digits An integer representing the number of fractional digits (those to the right of the decimal delimiter) to be written in a formatted monetary quantity using int_curr_symbol. The keyword shall be specified, unless the "copy" keyword is used. frac_digits An integer representing the number of fractional digits (those to the right of the decimal delimiter) to be written in a formatted monetary quantity using currency_symbol. The keyword shall be specified, unless the "copy" keyword is used. p_cs_precedes An integer set to 1 if the currency_symbol precedes the value for a nonnegative formatted monetary quantity, and set to 0 if the symbol succeeds the value. The keyword shall be specified, unless the "copy" keyword is used. p_sep_by_space An integer set to 0 if no space separates the currency_symbol from the value for a nonnegative formatted monetary quantity, set to 1 if a space separates the symbol from the value, and set to 2 if a space separates the symbol and the sign string, if adjacent. The keyword shall be specified, unless the "copy" keyword is used. n_cs_precedes An integer set to 1 if the currency_symbol precedes the value for a negative formatted monetary quantity, and set to 0 if the symbol succeeds the value. The keyword shall be specified, unless the "copy" keyword is used. n_sep_by_space An integer set to 0 if no space separates the currency_symbol from the value for a negative formatted monetary quantity, set to 1 if a space separates the symbol from the value, and set to 2 if a space separates the symbol and the sign string, if adjacent. The keyword shall be specified, unless the "copy" keyword is used. int_p_cs_precedes An integer set to 1 if the int_curr_symbol precedes the value for a nonnegative formatted monetary quantity, and set to 0 if the symbol succeeds the value. If not specified, the value of p_cs_precedes is taken. int_p_sep_by_space An integer set to 0 if no space separates the int_curr_symbol from the value for a nonnegative formatted monetary quantity, set to 1 if a space separates the symbol from the value, and set to 2 if a space separates the symbol and the sign string, if adjacent. If not specified, the value of p_sep_by_space is taken. int_n_cs_precedes An integer set to 1 if the int_curr_symbol precedes the value for a negative formatted monetary quantity, and set to 0 if the symbol succeeds the value. If not specified, the value of n_cs_precedes is taken. int_n_sep_by_space An integer set to 0 if no space separates the int_curr_symbol from the value for a negative formatted monetary quantity, set to 1 if a space separates the symbol from the value, and set to 2 if a space separates the symbol and the sign string, if adjacent. If not specified, the value of n_sep_by_space is taken. p_sign_posn An integer set to a value indicating the positioning of the positive_sign for a nonnegative formatted monetary quantity using the currency_symbol. The following integer values shall be defined: 0 Parentheses enclose the quantity and the currency_symbol. 1 The sign string precedes the quantity and the currency_symbol. 2 The sign string succeeds the quantity and the currency_symbol. 3 The sign string immediately precedes the currency_symbol. 4 The sign string immediately succeeds the currency_symbol. The keyword shall be specified, unless the "copy" keyword is used. n_sign_posn An integer set to a value indicating the positioning of the negative_sign for a negative formatted monetary quantity using the currency_symbol. The following integer values shall be defined: 0 Parentheses enclose the quantity and the int_curr_symbol. 1 The sign string precedes the quantity and the currency_symbol. 2 The sign string succeeds the quantity and the currency_symbol. 3 The sign string immediately precedes the currency_symbol. 4 The sign string immediately succeeds the currency_symbol. The keyword shall be specified, unless the "copy" keyword is used. int_p_sign_posn An integer set to a value indicating the positioning of the positive_sign for a nonnegative formatted international monetary quantity. The following integer values shall be defined: 0 Parentheses enclose the quantity and the int_curr_symbol. 1 The sign string precedes the quantity and the int_curr_symbol. 2 The sign string succeeds the quantity and the int_curr_symbol. 3 The sign string immediately precedes the int_curr_symbol. 4 The sign string immediately succeeds the int_curr_symbol. If no int_p_sign_posn is present the value of the p_sign_posn is taken. int_n_sign_posn An integer set to a value indicating the positioning of the negative_sign for a negative formatted international monetary quantity. The following integer values shall be defined: 0 Parentheses enclose the quantity and the int_curr_symbol. 1 The sign string precedes the quantity and the int_curr_symbol. 2 The sign string succeeds the quantity and the int_curr_symbol. 3 The sign string immediately precedes the int_curr_symbol. 4 The sign string immediately succeeds the int_curr_symbol. If no int_n_sign_posn is present the value of the n_sign_posn is taken. duo_int_curr_symbol The second international currency symbol. The operand shall be a four character string, with the first three characters containing the alphabetic international currency symbol in accordance with those specified in ISO 4217 (Codes for the representation of currencies and funds). The fourth character shall be the charac- ter used to separate the international currency symbol from the monetary quantity. The keyword is optional. duo_currency_symbol The string that shall be used as the second local currency symbol. duo_int_frac_digits An integer representing the number of fractional digits (those to the right of the decimal delimiter) to be written in a formatted monetary quantity using duo_int_curr_symbol. The keyword is optional. duo_frac_digits An integer representing the number of fractional digits (those to the right of the decimal delimiter) to be written in a formatted monetary quantity using duo_currency_symbol. The keyword is optional. duo_p_cs_precedes An integer set to 1 if the duo_currency_symbol precedes the value for a nonnegative formatted monetary quantity, and set to 0 if the symbol succeeds the value. The keyword is optional. duo_p_sep_by_space An integer set to 0 if no space separates the duo_currency_symbol from the value for a nonnegative formatted monetary quantity, set to 1 if a space separates the symbol from the value, and set to 2 if a space separates the symbol and the sign string, if adjacent. The keyword is optional. duo_n_cs_precedes An integer set to 1 if the duo_currency_symbol precedes the value for a negative formatted monetary quantity, and set to 0 if the symbol succeeds the value. The keyword is optional. duo_n_sep_by_space An integer set to 0 if no space separates the duo_currency_symbol from the value for a negative formatted monetary quantity, set to 1 if a space separates the symbol from the value, and set to 2 if a space separates the symbol and the sign string, if adjacent. The keyword is optional. duo_int_p_cs_precedes An integer set to 1 if the duo_int_curr_symbol precedes the value for a nonnegative formatted monetary quantity, and set to 0 if the symbol succeeds the value. If not specified, the value of duo_p_cs_precedes is taken. duo_int_p_sep_by_space An integer set to 0 if no space separates the duo_int_curr_symbol from the value for a nonnegative formatted monetary quantity, set to 1 if a space separates the symbol from the value, and set to 2 if a space separates the symbol and the sign string, if adjacent. If not specified, the value of duo_p_sep_by_space is taken. duo_int_n_cs_precedes An integer set to 1 if the duo_int_curr_symbol precedes the value for a negative formatted monetary quantity, and set to 0 if the symbol succeeds the value. If not specified, the value of duo_n_cs_precedes is taken. duo_int_n_sep_by_space An integer set to 0 if no space separates the duo_int_curr_symbol from the value for a negative formatted monetary quantity, set to 1 if a space separates the symbol from the value, and set to 2 if a space separates the symbol and the sign string, if adjacent. If not specified, the value of duo_n_sep_by_space is taken. duo_p_sign_posn An integer set to a value indicating the positioning of the positive_sign for a nonnegative formatted monetary quantity using the duo_currency_symbol. The following integer values shall be defined: 0 Parentheses enclose the quantity and the duo_currency_symbol. 1 The sign string precedes the quantity and the duo_currency_symbol. 2 The sign string succeeds the quantity and the duo_currency_symbol. 3 The sign string immediately precedes the duo_currency_symbol. 4 The sign string immediately succeeds the duo_currency_symbol. The keyword is optional. duo_n_sign_posn An integer set to a value indicating the positioning of the negative_sign for a negative formatted monetary quantity using the duo_currency_symbol. The following integer values shall be defined: 0 Parentheses enclose the quantity and the int_curr_symbol. 1 The sign string precedes the quantity and the duo_currency_symbol. 2 The sign string succeeds the quantity and the duo_currency_symbol. 3 The sign string immediately precedes the duo_currency_symbol. 4 The sign string immediately succeeds the duo_currency_symbol. The keyword is optional. duo_int_p_sign_posn An integer set to a value indicating the positioning of the positive_sign for a nonnegative formatted second international monetary quantity. The following integer values shall be defined: 0 Parentheses enclose the quantity and the duo_int_curr_symbol. 1 The sign string precedes the quantity and the duo_int_curr_symbol. 2 The sign string succeeds the quantity and the duo_int_curr_symbol. 3 The sign string immediately precedes the duo_int_curr_symbol. 4 The sign string immediately succeeds the duo_int_curr_symbol. If no duo_int_p_sign_posn is present the value of the p_sign_posn is taken. duo_int_n_sign_posn An integer set to a value indicating the positioning of the negative_sign for a negative formatted second international monetary quantity. The following integer values shall be defined: 0 Parentheses enclose the quantity and the duo_int_curr_symbol. 1 The sign string precedes the quantity and the duo_int_curr_symbol. 2 The sign string succeeds the quantity and the duo_int_curr_symbol. 3 The sign string immediately precedes the duo_int_curr_symbol. 4 The sign string immediately succeeds the duo_int_curr_symbol. If no duo_int_n_sign_posn is present the value of the duo_n_sign_posn is taken. uno_valid_from an integer representing a Gregorian date in the form YYYYMMDD, specifying the beginning date (inclusive) of the validity of the first currency. If not specified, it is taken to be the beginning of time. uno_valid_to an integer representing a Gregorian date in the form YYYYMMDD, specifying the end date (inclusive) of the validity of the first currency. If not specified, it is taken to be the end of time. duo_valid_from an integer representing a Gregorian date in the form YYYYMMDD, specifying the beginning date (inclusive) of the validity of the second currency. If not specified, it is taken to be the beginning of time. duo_valid_to an integer representing a Gregorian date in the form YYYYMMDD, specifying the end date (inclusive) of the validity of the second currency. If not specified, it is taken to be the end of time. conversion_rate two integers separated by a specifying the fixed conversion rate between the first and second currencies; the first integer is for multiplying the first currency, and the second for dividing this result to get the amount in the second currency. The "i18n" FDCC-set is defined as follows for the LC_MONETARY category. LC_MONETARY % This is the 14652 i18n fdcc-set definition for % the LC_MONETARY category. % int_curr_symbol "" currency_symbol "" mon_decimal_point "" mon_thousands_sep "" mon_grouping -1 positive_sign "" negative_sign "" int_frac_digits -1 frac_digits -1 p_cs_precedes -1 p_sep_by_space -1 n_cs_precedes -1 n_sep_by_space -1 p_sign_posn -1 n_sign_posn -1 % END LC_MONETARY B.1.3 LC_MONETARY Rationale. The currency symbol does not appear in LC_MONETARY because it is not defined in the C Standard's C locale. The C Standard limits the size of decimal points and thousands delimiters to single-byte values. In FDCC-sets based on multibyte coded character sets this cannot be enforced, obviously; this standard does not prohibit such characters, but makes the behaviour unspecified (in the text "In contexts where other standards . . . "). The grouping specification is based on, but not identical to, the C Standard . The "-1" signals that no further grouping shall be performed, the equivalent of (CHAR_MAX) in the C Standard ). The FDCC-set definition is an extension of the C Standard localeconv() specification. In particular, rules on how currency_symbol is treated are extended to also cover int_- curr_symbol, and p_set_by_space and n_sep_by_space have been augmented with the value 2, which places a space between the sign and the symbol (if they are adjacent; otherwise it should be treated as a 0). The following table shows the result of various combinations: p_sep_by_space 2 1 0 p_cs_precedes = 1 p_sign_posn = 0 ($ 1.25) ($ 1.25) ($1.25) p_sign_posn = 1 + $1.25 +$ 1.25 +$1.25 p_sign_posn = 2 $1.25 + $ 1.25+ $1.25+ p_sign_posn = 3 + $1.25 +$ 1.25 +$1.25 p_sign_posn = 4 $ +1.25 $+ 1.25 $+1.25 p_cs_precedes = 0 p_sign_posn = 0 (1.25 $) (1.25 $) (1.25$) p_sign_posn = 1 +1.25 $ +1.25 $ +1.25$ p_sign_posn = 2 1.25$ + 1.25 $+ 1.25$+ p_sign_posn = 3 1.25+ $ 1.25 +$ 1.25+$ p_sign_posn = 4 1.25$ + 1.25 $+ 1.25$+ The following is an example of the interpretation of the mon_grouping keyword. Assuming that the value to be formatted is 123456789 and the mon_thousands_sep is "'", then the following table shows the result. The third column shows the equivalent C Standard string that would be used to accommodate this grouping. It is the responsibility of the utility to perform mappings of the formats in this clause to those used by language bindings such as the C Standard . Mon_grouping Formatted Value C String 3;-1 123456'789 "\3\177" 3 123'456'789 "\3" 3;2;-1 1234'56'789 "\3\2\177" 3;2 12'34'56'789 "\3\2" -1 123456789 "177" In these examples, the octal value of (CHAR_MAX) is 177. The dual currency support is specified such that a FDCC-set can be used without change during the transition period in a static environment. For example in the case of the Euro currency as being employed in a number of European countries, there is no need to change the FDCC-set when shifting from one currency to two concurrent currencies; and there is no need to change FDCC-set, when changing to the Euro as the only currency. Also the same application call can be made to be valid for countries with a single currency and countries with dual currencies. The specifications can also be used without change of the FDCC-set on an installation, when converting from one national currency to another, for example when removing some zeroes to form a new currency. The following example illustrates the support for dual currencies; the example is for the Euro in Germany. LC_MONETARY int_curr_symbol "" currency_symbol "" mon_decimal_point "<,>" mon_thousands_sep "<.>" mon_grouping 3;3 positive_sign "" negative_sign "<->" 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 4 n_sign_posn 4 duo_int_curr_symbol "" duo_currency_symbol "" duo_mon_decimal_point "<,>" duo_mon_thousands_sep "<.>" duo_mon_grouping 3;3 duo_positive_sign "" duo_negative_sign "<->" duo_int_frac_digits 2 duo_frac_digits 2 duo_p_cs_precedes 1 duo_p_sep_by_space 2 duo_n_cs_precedes 1 duo_n_sep_by_space 2 duo_p_sign_posn 4 duo_n_sign_posn 4 uno_valid_to 20020630 duo_valid_from 19990101 conversion_rate 195;100 END LC_MONETARY