Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ localeconv(3C) — sys5 — Apollo Domain/OS SR10.4.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

setlocale(3C)

LOCALECONV(3C)                  Domain/OS SysV                  LOCALECONV(3C)



NAME
     localeconv - Access the current locale's conventions for formatting
     numeric quantities

SYNOPSIS
     #include <locale.h>

     struct lconv *localeconv(void)

DESCRIPTION
     The localeconv function returns a pointer to the lconv object, which
     specifies the current locale's conventions for the format of numeric
     quantities.

     lconv includes members that point to character strings (char *).  With
     the exception of the decimal_point member, any of the members can point
     to a NULL string to indicate that the value is unavailable within the
     current locale, or has a length of zero.

     Object members that are of type char are nonnegative numbers, any of
     which may be set to CHAR_MAX to indicate that the value is not available
     in the current locale.

     The lconv structure contains the following members specifying how
     monetary and non-monetary values are formatted for a given locale:

     struct lconv {
         char    *int_curr_symbol;      /* international currency sym. */
         char    *currency_symbol;      /* (local) currency sym. */
         char    *mon_decimal_point;    /* monetary decimal point */
         char    *mon_thousands_sep;    /* monetary thousands separator */
         char    *mon_grouping;         /* monetary grouping */
         char    *positive_sign;        /* positive sign */
         char    *negative_sign;        /* negative sign */
         char    int_frac_digits;       /* international fractional digits */
         char    frac_digits;           /* fractional digits */
         char    p_cs_precedes;         /* pos. currency sym. preceeds */
         char    p_sep_by_space;        /* pos. currency sym. sep. by space */
         char    p_sign_posn;           /* pos. sign position */
         char    n_cs_precedes;         /* neg. currency sym. preceeds */
         char    n_sep_by_space;        /* neg. currency sym. sep. by space */
         char    n_sign_posn;           /* neg. sign position */
         char    *decimal_point;        /* decimal point (aka RADIXCHAR) */
         char    *thousands_sep;        /* thousands separator */
         char    *grouping;             /* grouping */
     };

     The elements of grouping and mon_grouping are interpreted according to
     the following:

     MAX_CHAR  No further grouping is to be performed

     0         The previous element is to be used repeatedly for the remainder
               of the digits.

     other     (Reg.)The next element is examined to determine the size of the
               next group of digits to the left of the current group.

     The value of p_sign_posn and n_sign_posn is interpreted according to the
     following:

     0    Patenthesis surrounded the quantity and currency_symbol

     1    The sign string precedes the quantity and currency_symbol

     2    The sign string succeeds the quantity and currency_symbol

     3    The sign string immediately  precedes the currency_symbol

     4    The sign string immediately  succeeds the currency_symbol

NOTE
     Library functions do not call localeconv.

DIAGNOSTICS
     localeconv returns a pointer to a lconv structure filled in with values
     appropriate for the currently set locale. The object should not be
     modified by the program, though it may be overwritten by a subsequent
     call to localeconv. The object's contents may be overwritten by calls to
     setlocale(3C) with categories LC_ALL, LC_MONETARY, or LC_NUMERIC.

SEE ALSO
     setlocale(3C), locale.h.

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026