2.7.13. lconv 構造体

lconv 構造体は、数値形式情報を保持します。 この構造体は、 _get_lconv()localeconv() の 2 つの関数で充填されます。

Example 2.9 は、locale.h に含まれている lconv の定義を示しています。

Example 2.9. lconv 構造体

struct lconv {
  char *decimal_point;
       /* The decimal point character used to format non monetary quantities */	
  char *thousands_sep;	
       /* The character used to separate groups of digits to the left of the */	
       /* decimal point character in formatted non monetary quantities.      */	
  char *grouping;
       /* A string whose elements indicate the size of each group of digits  */	
       /* in formatted non monetary quantities. See below for more details.  */	
  char *int_curr_symbol;
       /* The international currency symbol applicable to the current locale.*/	
       /* The first three characters contain the alphabetic international    */	
       /* currency symbol in accordance with those specified in ISO 4217.    */	
       /* Codes for the representation of Currency and Funds. The fourth     */	
       /* character (immediately preceding the null character) is the        */	
       /* character used to separate the international currency symbol from  */	
       /* the monetary quantity.                                             */	
  char *currency_symbol;	
       /* The local currency symbol applicable to the current locale.        */	
  char *mon_decimal_point;	
       /* The decimal-point used to format monetary quantities.              */	
  char *mon_thousands_sep;	
       /* The separator for groups of digits to the left of the decimal-point*/	
       /* in formatted monetary quantities.                                  */	
  char *mon_grouping;	
       /* A string whose elements indicate the size of each group of digits  */	
       /* in formatted monetary quantities. See below for more details.      */	
  char *positive_sign;	
       /* The string used to indicate a non negative-valued formatted        */	
       /* monetary quantity.                                                 */	
  char *negative_sign;	
       /* The string used to indicate a negative-valued formatted monetary   */	
       /* quantity.                                                          */	
  char int_frac_digits;	
       /* The number of fractional digits (those to the right of the         */	
       /* decimal-point) to be displayed in an internationally formatted     */	
       /* monetary quantities.                                               */	
  char frac_digits;	
       /* The number of fractional digits (those to the right of the         */	
       /* decimal-point) to be displayed in a formatted monetary quantity.   */	
  char p_cs_precedes;	
       /* Set to 1 or 0 if the currency_symbol respectively precedes or      */	
       /* succeeds the value for a non negative formatted monetary quantity. */	
  char p_sep_by_space;	
       /* Set to 1 or 0 if the currency_symbol respectively is or is not     */	
       /* separated by a space from the value for a non negative formatted   */	
       /* monetary quantity.                                                 */	
  char n_cs_precedes;	
       /* Set to 1 or 0 if the currency_symbol respectively precedes or      */	
       /* succeeds the value for a negative formatted monetary quantity.     */	
  char n_sep_by_space;	
       /* Set to 1 or 0 if the currency_symbol respectively is or is not     */	
       /* separated by a space from the value for a negative formatted       */	
       /* monetary quantity.                                                 */	
  char p_sign_posn;	
       /* Set to a value indicating the position of the positive_sign for a  */	
       /* non negative formatted monetary quantity. See below for more details*/	
  char n_sign_posn;	
       /* Set to a value indicating the position of the negative_sign for a  */	
       /* negative formatted monetary quantity. */	
};

groupingnon_grouping の要素(Example 2.9 に示されている)は、以下のように解釈されます。

CHAR_MAX

それ以上のグループ化は実行されないことを示しています。

0

残りの桁で前の要素が繰り返されることを示しています。

その他

その値が、現在のグループを構成する桁数を示します。 次の要素が検査されて、現在のグループの左側にくる次のグループの桁数が決定されます。

p_sign_posnn_sign_posn の値(Example 2.9 に示されている)は、以下のように解釈されます。

0

数量と通貨記号が括弧で囲まれます。

1

数量と通貨記号の前に符号文字列が付けられます。

2

数量と通貨記号の後に符号文字列が付けられます。

3

通貨記号の直前に符号文字列が付けられます。

4

通貨記号の直後に符号文字列が付けられます。

Copyright © 2007 ARM Limited. All rights reserved.ARM DUI 0349AJ
Non-Confidential