MyWebUniversity.com Home Page
 



Darwin Mac OS X man pages main menu
LOCALECONV(3)            BSD Library Functions Manual            LOCALECONV(3)

NAME
     localeconv, localeconvl -- natural language formatting for C

LIBRARY
     Standard C Library (libc, -lc)

SYNOPSIS
     ##include <>

     struct lconv *
     localeconv(void);

     ##include <>

     struct lconv *
     localeconvl(void, localet loc);

DESCRIPTION
     The localeconv() function returns a pointer to a structure which provides
     parameters for formatting numbers, especially currency values:

           struct lconv {
                   char    *decimalpoint;
                   char    *thousandssep;
                   char    *grouping;
                   char    *intcurrsymbol;
                   char    *currencysymbol;
                   char    *mondecimalpoint;
                   char    *monthousandssep;
                   char    *mongrouping;
                   char    *positivesign;
                   char    *negativesign;
                   char    intfracdigits;
                   char    fracdigits;
                   char    pcsprecedes;
                   char    psepbyspace;
                   char    ncsprecedes;
                   char    nsepbyspace;
                   char    psignposn;
                   char    nsignposn;
                   char    intpcsprecedes;
                   char    intncsprecedes;
                   char    intpsepbyspace;
                   char    intnsepbyspace;
                   char    intpsignposn;
                   char    intnsignposn;
           };

     The individual fields have the following meanings:

     decimalpoint      The decimal point character, except for currency val-
                        ues, cannot be an empty string.

     thousandssep      The separator between groups of digits before the dec-
                        imal point, except for currency values.

     grouping           The sizes of the groups of digits, except for currency
                        values.  This is a pointer to a vector of integers,
                        each of size char, representing group size from low
                        order digit groups to high order (right to left).  The
                        list may be terminated with 0 or CHARMAX.  If the
                        list is terminated with 0, the last group size before
                        the 0 is repeated to account for all the digits.  If
                        the list is terminated with CHARMAX, no more grouping
                        is performed.

     intcurrsymbol    The standardized international currency symbol.

     currencysymbol    The local currency symbol.

     mondecimalpoint  The decimal point character for currency values.

     monthousandssep  The separator for digit groups in currency values.

     mongrouping       Like grouping but for currency values.

     positivesign      The character used to denote nonnegative currency val-
                        ues, usually the empty string.

     negativesign      The character used to denote negative currency values,
                        usually a minus sign.

     intfracdigits    The number of digits after the decimal point in an
                        international-style currency value.

     fracdigits        The number of digits after the decimal point in the
                        local style for currency values.

     pcsprecedes      1 if the currency symbol precedes the currency value
                        for nonnegative values, 0 if it follows.

     psepbyspace     1 if a space is inserted between the currency symbol
                        and the currency value for nonnegative values, 0 oth-
                        erwise.

     ncsprecedes      Like pcsprecedes but for negative values.

     nsepbyspace     Like psepbyspace but for negative values.

     psignposn        The location of the positivesign with respect to a
                        nonnegative quantity and the currencysymbol, coded as
                        follows:

                        0    Parentheses around the entire string.
                        1    Before the string.
                        2    After the string.
                        3    Just before currencysymbol.
                        4    Just after currencysymbol.

     nsignposn        Like psignposn but for negative currency values.

     intpcsprecedes  Same as pcsprecedes, but for internationally format-
                        ted monetary quantities.

     intncsprecedes  Same as ncsprecedes, but for internationally format-
                        ted monetary quantities.

     intpsepbyspace
                        Same as psepbyspace, but for internationally for-
                        matted monetary quantities.

     intnsepbyspace
                        Same as nsepbyspace, but for internationally for-
                        matted monetary quantities.

     intpsignposn    Same as psignposn, but for internationally formatted
                        monetary quantities.

     intnsignposn    Same as nsignposn, but for internationally formatted
                        monetary quantities.

     Unless mentioned above, an empty string as a value for a field indicates
     a zero length result or a value that is not in the current locale.  A
     CHARMAX result similarly denotes an unavailable value.

     While the localeconv() function uses the current locale, the
     localeconvl() function may be passed a locale directly. See xlocale(3)
     for more information.

RETURN VALUES
     The localeconv() function returns a pointer to a static object which may
     be altered by later calls to setlocale(3) or localeconv().

ERORS
     No errors are defined.

SEE ALSO
     setlocale(3), strfmon(3), xlocale(3)

STANDARDS
     The localeconv() function conforms to ISO/IEC 9899:1999 (``ISO C99'').

HISTORY
     The localeconv() function first appeared in 4.4BSD.

BSD                            November 21, 2003                           BSD
Darwin Mac OS X man pages main menu

Contact us      |       About us      |       Term of use      |       Copyright © 2000-2010 MyWebUniversity.com ™