Guardian Native C Library Calls Reference Manual (G06.28+, H06.04+)
strfmon(3) Guardian Native C Library Calls Reference Manual
NAME
strfmon - Formats monetary strings
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZCRTLSRL
G-series native OSS processes: /G/system/sysnn/zcrtlsrl
H-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCRTLDLL
H-series OSS processes: /G/system/zdllnnn/zcrtldll
SYNOPSIS
include <sys/types.h>
#include <monetary.h>
ssize_t strfmon(
char *s,
size_t maxsize,
char *format
[,double value]...);
PARAMETERS
s Contains the output of the strfmon() function.
maxsize Specifies the maximum number of bytes (including the null terminating byte)
that may be placed in the s parameter.
format Contains characters and conversion specifications.
value Specifies the double data to be converted according to the format parameter.
DESCRIPTION
The strfmon() function converts numeric values to monetary strings according to the
specifications in the format parameter. It converts the double-precision floating-point value
parameters under the control of the format parameter and stores the result in the array specified
by the s parameter.
The format parameter is a character string that contains two types of objects:
• Literal characters, which are copied to the output stream.
• Conversion specifications, each of which causes zero or more items to be fetched from
the value parameter list.
If there are insufficient parameters for the format parameter, the results are undefined. If parame-
ters remain after the format parameter is exhausted, the excess parameters are ignored.
Conversion Specifications
A conversion specification consists of a % (percent sign) character, optional flags, optional field
width, optional left precision, optional right precision, and a required conversion character that
determines the conversion to be performed.
Each conversion specification in the format parameter has the following syntax:
• A % (percent sign).
• Zero or more optional flags can be specified to control the conversion. The flag charac-
ters and their meanings are as follows:
=f An = (equal sign) followed by a single character that specifies the numeric fill
character. The default numeric fill character is the space character. This flag
does not affect field-width filling, which always uses the space character. This
6−56 Hewlett-Packard Company 527192-005