locale.h.3 (4005B)
1 .TH locale.h 3 2 .SH NAME 3 locale.h - localization category macros 4 .SH SYNOPSIS 5 #include <locale.h> 6 7 The locale.h header declares the following functions: 8 9 .nf 10 char *setlocale(int category, const char *locale); 11 struct lconv *localeconv(void); 12 .fi 13 .SH DESCRIPTION 14 The locale.h header defines the following macros: 15 16 .nf 17 LC_ALL 18 LC_COLLATE 19 LC_CTYPE 20 LC_MESSAGES 21 LC_MONETARY 22 LC_NUMERIC 23 LC_TIME 24 .fi 25 26 Each macro expands to a distinct integer constant expression 27 that may be passed as the 28 .I category 29 argument to 30 .BR setlocale . 31 32 The locale.h header also declares the lconv structure with at least 33 the following members: 34 35 .nf 36 char *currency_symbol 37 char *decimal_point 38 char frac_digits 39 char *grouping 40 char *int_curr_symbol 41 char int_frac_digits 42 char int_n_cs_precedes 43 char int_n_sep_by_space 44 char int_n_sign_posn 45 char int_p_cs_precedes 46 char int_p_sep_by_space 47 char int_p_sign_posn 48 char *mon_decimal_point 49 char *mon_grouping 50 char *mon_thousands_sep 51 char *negative_sign 52 char n_cs_precedes 53 char n_sep_by_space 54 char n_sign_posn 55 char *positive_sign 56 char p_cs_precedes 57 char p_sep_by_space 58 char p_sign_posn 59 char *thousands_sep 60 .fi 61 62 The members of the 63 .I lconv 64 structure are: 65 .TP 10 66 currency_symbol 67 The currency symbol used in the current locale. 68 .TP 69 decimal_point 70 The decimal separator for non-monetary numeric values. 71 .TP 72 thousands_sep 73 The character that separates digit groups 74 to the left of the decimal point in non-monetary values. 75 .TP 76 grouping 77 A string encoding the sizes of digit groups in 78 formatted non-monetary quantities. 79 .TP 80 mon_decimal_point 81 The decimal separator used in monetary values. 82 .TP 83 mon_thousands_sep 84 The digit group separator for monetary quantities. 85 .TP 86 mon_grouping 87 A string encoding the sizes of digit groups in 88 formatted monetary quantities. 89 .TP 90 positive_sign 91 The string used to mark a non-negative monetary value. 92 .TP 93 negative_sign 94 The string used to mark a negative monetary value. 95 .TP 96 frac_digits 97 The number of digits after the decimal point in a locally 98 formatted monetary quantity. 99 .TP 100 p_cs_precedes 101 Set to 1 if currency_symbol comes before the value 102 for a non-negative locally formatted monetary quantity, 103 or 0 if it follows. 104 .TP 105 n_cs_precedes 106 Set to 1 if currency_symbol comes before the value 107 for a negative locally formatted monetary quantity, 108 or 0 if it follows. 109 .TP 110 p_sep_by_space 111 Encodes the spacing between currency_symbol, the sign string, 112 and the value for a non-negative locally formatted monetary quantity. 113 .TP 114 n_sep_by_space 115 Encodes the spacing between currency_symbol, the sign string, 116 and the value for a negative locally formatted monetary quantity. 117 .TP 118 p_sign_posn 119 Encodes where the positive_sign is placed for a non-negative 120 locally formatted monetary quantity. 121 .TP 122 n_sign_posn 123 Encodes where the negative_sign is placed for a negative 124 locally formatted monetary quantity. 125 .TP 126 int_curr_symbol 127 The international currency symbol for the current locale. 128 .TP 129 int_frac_digits 130 The number of digits after the decimal point in an internationally 131 formatted monetary quantity. 132 .TP 133 int_p_cs_precedes 134 Set to 1 if int_curr_symbol comes before the value 135 for a non-negative internationally formatted monetary quantity, 136 or 0 if it follows. 137 .TP 138 int_n_cs_precedes 139 Set to 1 if int_curr_symbol comes before the value 140 for a negative internationally formatted monetary quantity, 141 or 0 if it follows. 142 .TP 143 int_p_sep_by_space 144 Encodes the spacing between int_curr_symbol, the sign string, 145 and the value for a non-negative internationally formatted monetary quantity. 146 .TP 147 int_n_sep_by_space 148 Encodes the spacing between int_curr_symbol, the sign string, 149 and the value for a negative internationally formatted monetary quantity. 150 .TP 151 int_p_sign_posn 152 Encodes where the positive_sign is placed for a non-negative 153 internationally formatted monetary quantity. 154 .TP 155 int_n_sign_posn 156 Encodes where the negative_sign is placed for a negative 157 internationally formatted monetary quantity. 158 .SH STANDARDS 159 ISO/IEC 9899:1999 Section 7.11 160 161 ISO/IEC 9899:1999 Section 7.11.2.1 162 .SH SEE ALSO 163 .BR localeconv (3) 164 .BR setlocale (3)