Library /sys$common/syshlp/helplib.hlb  —  CRTL  strfmon  Description
    The strfmon function creates a string pointed to by s, using the
    monetary values supplied. A maximum of maxsize bytes is copied to
    s.

    The format string pointed to by format consists of ordinary
    characters and conversion specifications. All ordinary characters
    are copied unchanged to the output string. A conversion
    specification defines how one of the monetary values supplied
    is formatted in the output string.

    A conversion specification consists of a percent character
    (%), followed by a number of optional characters (see Optional
    Characters in strfmon Conversion Specifications), and concluding
    with a conversion specifier (see strfmon Conversion Specifiers).

    If any of the optional characters listed in Optional Characters
    in strfmon Conversion Specifications is included in a conversion
    specification, they must appear in the order shown.

    Table REF-5 Optional Characters in strfmon Conversion
                Specifications

    Character     Meaning

                  left precision is specified. The default numeric
                  fill character is the space character. The fill
                  character must be representable as a single byte
                  in order to work with precision and width count.
                  This conversion specifier is ignored unless a
                  left precision is specified, and it does not
                  affect width filling, which always uses the space
                  character.
    ^             Do not use separator characters to format the
                  number. By default, the digits are grouped
                  according to the mon_grouping field in the LC_
                  MONETARY category of the current locale.
    +             Add the string specified by the positive_sign
                  or negative_sign fields in the current locale.
                  If p_sign_posn or n_sign_posn is set to 0, then
                  parentheses are used by default to indicate
                  negative values. Otherwise, sign strings are used
                  to indicate the sign of the value. You cannot use a
                  + and a ( in the same conversion specification.
    (             Enclose negative values within parentheses. The
                  default is taken from the p_sign_posn and n_sign_
                  posn fields in the current locale. If p_sign_
                  posn or n_sign_posn is set to 0, then parentheses
                  are used by default to indicate negative values.
                  Otherwise, sign strings are used to indicate the
                  sign of the value. You cannot use a + and ( in the
                  same conversion specification.
    !             Suppress the currency symbol. By default, the
                  currency symbol is included.
    -             Left-justify the value within the field. By
                  default, values are right-justified.
    field width   A decimal integer that specifies the minimum
                  field width in which to align the result of the
                  conversion. The default field width is the smallest
                  field that can contain the result.
    #left_        A # followed by a decimal integer specifies
    precision     the number of digits to the left of the radix
                  character. Extra positions are filled by the
                  fill character. By default the precision is the
                  smallest required for the argument. If grouping
                  is not suppressed with the ^ conversion specifier,
                  and if grouping is defined for the current locale,
                  grouping separators are inserted before any fill
                  characters are added. Grouping separators are
                  not applied to fill characters even if the fill
                  character is defined as a digit.
    .right_       A period (.) followed by a decimal integer
    precision     specifies the number of digits to the right of
                  the radix character. Extra positions are filled
                  with zeros. The amount is rounded to this number
                  of decimal places. If the right precision is zero,
                  the radix character is not included in the output.
                  By default the right precision is defined by the
                  frac_digits or int_frac_digits field of the current
                  locale.

    Table REF-6 strfmon Conversion Specifiers

    SpecifierMeaning

    i        Use the international currency symbol defined by the
             int_currency_symbol field in the current locale, unless
             the currency symbol has been suppressed.
    n        Use the local currency symbol defined by the currency_
             symbol field in the current locale, unless the currency
             symbol has been suppressed.
    %        Output a % character. The conversion specification must
             be %%; none of the optional characters is valid with
             this specifier.
Close Help