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 Species the maximum number of bytes (including the null terminating byte)
that may be placed in the s parameter.
format Contains characters and conversion specications.
value Species the double data to be converted according to the format parameter.
DESCRIPTION
The strfmon() function converts numeric values to monetary strings according to the
specications in the format parameter. It converts the double-precision oating-point value
parameters under the control of the format parameter and stores the result in the array specied
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 specications, each of which causes zero or more items to be fetched from
the value parameter list.
If there are insufcient parameters for the format parameter, the results are undened. If parame-
ters remain after the format parameter is exhausted, the excess parameters are ignored.
Conversion Specications
A conversion specication consists of a % (percent sign) character, optional ags, optional eld
width, optional left precision, optional right precision, and a required conversion character that
determines the conversion to be performed.
Each conversion specication in the format parameter has the following syntax:
A % (percent sign).
Zero or more optional ags can be specied to control the conversion. The ag charac-
ters and their meanings are as follows:
=f An = (equal sign) followed by a single character that species the numeric ll
character. The default numeric ll character is the space character. This ag
does not affect eld-width lling, which always uses the space character. This
656 Hewlett-Packard Company 527192-005