| Skip Navigation Links | |
| Exit Print View | |
![]() | man pages section 3: Basic Library Functions Oracle Solaris 11 Information Library |
enable_extended_FILE_stdio(3C)
posix_spawnattr_getschedparam(3C)
posix_spawnattr_getschedpolicy(3C)
posix_spawnattr_getsigdefault(3C)
posix_spawnattr_getsigignore_np(3C)
posix_spawnattr_getsigmask(3C)
posix_spawnattr_setschedparam(3C)
posix_spawnattr_setschedpolicy(3C)
posix_spawnattr_setsigdefault(3C)
posix_spawnattr_setsigignore_np(3C)
posix_spawnattr_setsigmask(3C)
posix_spawn_file_actions_addclose(3C)
posix_spawn_file_actions_addclosefrom_np(3C)
posix_spawn_file_actions_adddup2(3C)
posix_spawn_file_actions_addopen(3C)
posix_spawn_file_actions_destroy(3C)
posix_spawn_file_actions_init(3C)
pthread_attr_getdetachstate(3C)
pthread_attr_getinheritsched(3C)
pthread_attr_getschedparam(3C)
pthread_attr_getschedpolicy(3C)
pthread_attr_setdetachstate(3C)
pthread_attr_setinheritsched(3C)
pthread_attr_setschedparam(3C)
pthread_attr_setschedpolicy(3C)
pthread_barrierattr_destroy(3C)
pthread_barrierattr_getpshared(3C)
pthread_barrierattr_setpshared(3C)
pthread_condattr_getpshared(3C)
pthread_condattr_setpshared(3C)
pthread_cond_reltimedwait_np(3C)
pthread_key_create_once_np(3C)
pthread_mutexattr_getprioceiling(3C)
pthread_mutexattr_getprotocol(3C)
pthread_mutexattr_getpshared(3C)
pthread_mutexattr_getrobust(3C)
pthread_mutexattr_setprioceiling(3C)
pthread_mutexattr_setprotocol(3C)
pthread_mutexattr_setpshared(3C)
pthread_mutexattr_setrobust(3C)
pthread_mutex_getprioceiling(3C)
pthread_mutex_reltimedlock_np(3C)
pthread_mutex_setprioceiling(3C)
pthread_rwlockattr_destroy(3C)
pthread_rwlockattr_getpshared(3C)
pthread_rwlockattr_setpshared(3C)
pthread_rwlock_reltimedrdlock_np(3C)
pthread_rwlock_reltimedwrlock_np(3C)
pthread_rwlock_timedrdlock(3C)
pthread_rwlock_timedwrlock(3C)
rctlblk_get_enforced_value(3C)
- get numeric formatting information
#include <locale.h>struct lconv *localeconv(void);
Thelocaleconv() function sets the components of an object with typestruct lconv(defined in<locale.h>) with the values appropriate for the formatting of numericquantities (monetary and otherwise) according to the rules of the current locale (seesetlocale(3C)). The definition ofstruct lconv is given below (the values forthe fields in the “C” locale are given in comments).
char *decimal_point; /* "." */char *thousands_sep; /* "" (zero length string) */char *grouping; /* "" */char *int_curr_symbol; /* "" */char *currency_symbol; /* "" */char *mon_decimal_point; /* "" */char *mon_thousands_sep; /* "" */char *mon_grouping; /* "" */char *positive_sign; /* "" */char *negative_sign; /* "" */char int_frac_digits; /* CHAR_MAX */char frac_digits; /* CHAR_MAX */char p_cs_precedes; /* CHAR_MAX */char p_sep_by_space; /* CHAR_MAX */char n_cs_precedes; /* CHAR_MAX */char n_sep_by_space; /* CHAR_MAX */char p_sign_posn; /* CHAR_MAX*/char n_sign_posn; /* CHAR_MAX */
The following members are also available to SUSv3–conforming applications. Seestandards(5)
char int_p_cs_precedes; /* CHAR_MAX */char int_p_sep_by_space; /* CHAR_MAX */char int_n_cs_precedes; /* CHAR_MAX */char int_n_sep_by_space; /* CHAR_MAX */char int_p_sign_posn; /* CHAR_MAX */char int_n_sign_posn; /* CHAR_MAX */
The members of the structure with typechar * are strings, any ofwhich (exceptdecimal_point) can point to a null string (""), to indicatethat the value is not available in the current locale or isof zero length. The members with typechar are non-negative numbers, any ofwhich can beCHAR_MAX (defined in the<limits.h> header) to indicate thatthe value is not available in the current locale. The members arethe following:
The decimal-point character used to format non-monetary quantities.
The character used to separate groups of digits to the left of the decimal-point character in formatted non-monetary quantities.
A string whose elements taken as one-byte integer values indicate the size of each group of digits in formatted non-monetary quantities.
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 the ISO 4217: 1995 standard. The fourth character (immediately preceding the null byte) is the character used to separate the international currency symbol from the monetary quantity.
The local currency symbol applicable to the current locale.
The decimal point used to format monetary quantities.
The separator for groups of digits to the left of the decimal point in formatted monetary quantities.
A string whose elements taken as one-byte integer values indicate the size of each group of digits in formatted monetary quantities.
The string used to indicate a non-negative-valued formatted monetary quantity.
The string used to indicate a negative-valued formatted monetary quantity.
The number of fractional digits (those to the right of the decimal point) to be displayed in an internationally formatted monetary quantity.
The number of fractional digits (those to the right of the decimal point) to be displayed in a formatted monetary quantity.
Set to 1 or 0 if thecurrency_symbol respectively precedes or succeeds the value for a non-negative formatted monetary quantity.
Set to 0 if no space separates thecurrency_symbol orint_curr_symbol from the value for a non-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.
Set to 1 or 0 if thecurrency_symbol respectively precedes or succeeds the value for a negative formatted monetary quantity.
Set to 0 if no space separates thecurrency_symbol orint_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.
Set to a value indicating the positioning of thepositive_sign for a non-negative formatted monetary quantity.
Set to a value indicating the positioning of thenegative_sign for a negative formatted monetary quantity.
Set to 1 or 0 if theint_curr_symbol respectively precedes or succeeds the value for a non-negative internationally formatted monetary quantity.
Set to 1 or 0 if theint_curr_symbol respectively precedes or succeeds the value for a negative internationally formatted monetary quantity.
Set to a value indicating the separation of theint_curr_symbol, the sign string, and the value for a non-negative internationally formatted monetary quantity.
Set to a value indicating the separation of theint_curr_symbol, the sign string, and the value for a negative internationally formatted monetary quantity.
Set to a value indicating the positioning of thepositive_sign for a non-negative internationally formatted monetary quantity.
Set to a value indicating the positioning of thenegative_sign for a negative internationally formatted monetary quantity.
The elements ofgrouping andmon_grouping are interpreted according to the following:
No further grouping is to be performed.
The previous element is to be repeatedly used for the remainder of the digits.
The integer value is the number of digits that comprise the current group. The next element is examined to determine the size of the next group of digits before the current group.
The values ofp_sep_by_space,n_sep_by_space,int_p_sep_by_space, andint_n_sep_by_space are interpreted according tothe following:
No space separates the currency symbol and value.
If the currency symbol and sign string are adjacent, a space separates them from the value; otherwise, a space separates the currency symbol from the value.
If the currency symbol and sign string are adjacent, a space separates them; otherwise, a space separates the sign string from the value.
In an SUSv3–conforming application, forint_p_sep_by_space andint_n_sep_by_space, the fourth character ofint_curr_symbol is used instead of a space.
The values ofp_sign_posn,n_sign_posn,int_p_sign_posn, andint_n_sign_posn are interpreted according tothe following:
Parentheses surround the quantity andcurrency_symbol orint_curr_symbol.
The sign string precedes the quantity andcurrency_symbol orint_curr_symbol.
The sign string succeeds the quantity andcurrency_symbol orint_curr_symbol.
The sign string immediately precedes thecurrency_symbol orint_curr_symbol.
The sign string immediately succeeds thecurrency_symbol orint_curr_symbol.
Thelocaleconv() function returns a pointer to the filled-in object. The structurepointed to by the return value may be overwritten by asubsequent call tolocaleconv().
Example 1 Rules used by four countries to format monetary quantities.
The following table illustrates the rules used by four countries to formatmonetary quantities.
|
For these four countries, the respective values for the monetary members ofthe structure returned bylocaleconv() are as follows:
|
Seeattributes(5) for descriptions of the following attributes:
|
Thelocaleconv() function can be used safely in multithreaded applications, as longassetlocale(3C) is not being called to change the locale.
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Legal Notices | ![]() ![]() |