'\"macro stdmacro
.if n .pH g1a.montbl @(#)montbl	40.9
.\" Copyright 1989 AT&T
.if \nX=0 .ds x} montbl 1M "System Administration Utilities" "\&"
.if \nX=1 .ds x} montbl 1M "C Programming Language Utilities"
.if \nX=2 .ds x} montbl 1M "" "\&"
.if \nX=3 .ds x} montbl "" "" "\&"
.ds e' \o"e\(ga"
.TH \*(x}
.SH NAME
\f4montbl\f1 \- create monetary database
.SH SYNOPSIS
\f4montbl\fP
[ \f4-o\fP
.IR outfile ]
.I infile
.SH DESCRIPTION
The \f4montbl\f1 command takes as input a specification file,
\f2infile\f1, that describes the formatting conventions
for monetary quantities for a specific
locale.
.PP
.TP 12
\f4-o\fP \f2outfile\f1
Write the output on \f2outfile\fP;
otherwise, write the output on a file named
\f4LC_MONETARY\f1.
.PP
The output of
\f4montbl\fP
is suitable for use by the
\f4localeconv\fP(\|) function
(see
\f4localeconv\fP(3C)).
Before \f2outfile\fP can be used by
\f4localeconv\fP(\|),
it must be installed in the
\f4/usr/lib/locale\f2/locale\f1
directory with the name
\f4LC_MONETARY\f1
by someone who is super-user
or a member of group
\f4bin\f1.
\f2locale\f1 is the locale whose monetary formatting 
conventions are described in \f2infile\f1.
This file must be readable by user,
group, and other; no other permissions should be set.
To use formatting conventions for monetary quantities described in this file,
use \f4setlocale\fP(3C) to change the locale for category \f4LC_MONETARY\f1
to \f2locale\f1 [see \f4setlocale\fP(3C)].
.PP
Once installed,
this file will be used by the \f4localeconv\fP(\|) function
to initialize the monetary specific fields of
a structure of type \f4struct lconv\f1.
For a description of each field in this structure,
see \f4localeconv\f1(3C).
.PP
.nf
\f4	struct 	lconv 	{
		char *decimal_point;		/* "." */
		char *thousands_sep;		/* "" (zero length string) */
		char *grouping;			/* "" */
		char *int_curr_symbol;	/* "" */
		char *currency_symbol;	/* "" */
		char *mon_decimal_point;	/* "" */
		char *mon_thousands_sep;	/* "" */
		char *mon_grouping;		/* "" */
		char *positive_sign;		/* "" */
		char *negative_sign;		/* "" */
		char int_frac_digits;		/* CHAR_MAX */
		char frac_digits;		/* CHAR_MAX */
		char p_cs_precedes;		/* CHAR_MAX */
		char p_sep_by_space;		/* CHAR_MAX */
		char n_cs_precedes;		/* CHAR_MAX */
		char n_sep_by_space;		/* CHAR_MAX */
		char p_sign_posn;		/* CHAR_MAX */
		char n_sign_posn;		/* CHAR_MAX */
	};

.fi
.ft 1
.PP
The specification file specifies the value of each 
\f4struct lconv\f1 member, except for
the first three members, \f2decimal_point\f1, \f2thousands_sep\f1,
and \f2grouping\f1
which are set by the \f4LC_NUMERIC\f1 category of \f4setlocale\f1(3C).
Each member's value is given on a line with the following format:
.nf

	\f2keyword\f1 <white space> \f2value\f1

.fi
where \f2keyword\f1 is identical to the \f4struct lconv\f1 field name and
\f2value\f1 is a quoted string for those fields that are a \f4char \(**\f1
and an integer for those fields that are an \f4int\f1. For example,
.nf
\f4
	int_curr_symbol		"ITL."
	int_frac_digits		0

\f1
.fi
will set the international currency symbol and the number of
fractional digits to be displayed in an internationally
formatted monetary quantity to \f4ITL.\f1 and \f40\f1, respectively.
.P
Blank lines and lines starting with a \f4#\fP are taken to be comments and are ignored.
A character in a string may be in octal or hex representation.
For example, \f4\\141\f1 or \f4\\x61\f1 could be used to represent
the letter 'a'.
If there is no specification line for a given structure member, then
the default 'C' locale value for that member is used (see the values
in comments in the \f4struct lconv\f1 definition above).
.P
Given below is an example of what the specification file for 
Italy would look like:
.PP
.nf
\f4	# Italy

	int_curr_symbol		"ITL."
	currency_symbol		"L."
	mon_decimal_point	""
	mon_thousands_sep	"."
	mon_grouping		"\\3"
	positive_sign		""
	negative_sign		"-"
	int_frac_digits		0
	frac_digits		0
	p_cs_precedes		1
	p_sep_by_space		0
	n_cs_precedes		1
	n_sep_by_space		0
	p_sign_posn		1
	n_sign_posn		1
.fi
.ft 1
.SH FILES
.TP 16
\f4/usr/lib/locale/\f2locale\f4/LC_MONETARY\f1
\f4LC_MONETARY\f1 database for \f2locale\f1
.TP
\f4/usr/lib/locale/C/montbl_C\fP
input file used to construct
\f4LC_MONETARY\fP
in the default locale.
.SH "SEE ALSO"
\f4localeconv\f1(3C), \f4setlocale\f1(3C)
in the \f2Programmer's Reference Manual\f1.
.\"	@(#)montbl.1
.Ee


