NLCONVNUM(3X)
NAME
nlconvnum − convert an MPE native language formatted number to an ASCII number
SYNOPSIS
.B "void nlconvnum(langid, instr, leninstr, outstr, plenoutstr, err, numspec, fmtmask, pdecimals)"} numspec, fmtmask, pdecimals)
unsigned short err[2];
short langid, leninstr, *plenoutstr, fmtmask, *pdecimals;
char *instr, *outstr, *numspec;
DESCRIPTION
Nlconvnum converts a native language formatted number to an ASCII number, with an n-computer decimal separator (.) and thousands separator (,), to use for further conversion to INTEGER, REAL, etc.
This routine converts the decimal separator and the thousands separators to the n-computer equivalent, or strips them, according to the value of fmtmask. If fmtmask and M_NUMBERSONLY is not zero , instr is validated as a number. If it is null, no validation will take place.
For languages using an alternate set of digits (currently only arabic, which uses HINDI digits), nlconvnum also converts these digits to ASCII digits so they can be recognized and used as numeric characters.
The arguments to nlconvnum are used as follows:
langid A language ID number.
instr A character buffer containing the native language formatted number to convert. Leading and trailing spaces are ignored.
leninstr Length, in bytes, of instr.
outstr Output buffer; an array containing the converted output. The output is left-justified in the buffer, and plenoutstr contains the actual length of the converted number. Outstring may refer to the same address as instr.
plenoutstr A pointer to the length, in bytes, of outstr. After a successful call to nlconvnum, the short integer to which plenoutstr points contains the actual length of the converted number.
err The first element of this array contains the error number. The second element is always zero. If the call is successful, both elements contain zero.
Error # Meaning
2 Specified language is not configured.
3 Invalid length specified (leninstr or plenoutstr).
4 Invalid number specified (instr).
7 Truncation has occurred (outstr is left partially formatted).
8 Invalid numspec parameter.
9 Invalid fmtmask parameter.
numspec A character buffer, as returned from nlnumspec, containing information about correct formatting. If this parameter is not null, langid is ignored and performance is improved (see the description of nlnumspec).
fmtmask An unsigned short specifying how to format the number. The default value is zero, which means substitution only, convert thousands separators, convert decimal separators, and that instr can contain any character.
Value Description
M_STRIPTHOU
− Strip thousands separators.
M_STRIPDEC
− Strip decimal separators.
M_NUMBERSONLY
− instr contains a number.
pdecimals
Pointer to a variable in which the number of decimal places in the input number is returned.
WARNINGS
This routine is provided for compatibility with MPE, another HP operating system. See portnls(5) for more information on the use of this routine. Use the Native Language Support routines for C programmers described on hpnls(5) for HP-UX NLS support.
AUTHOR
Nlconvnum was developed by HP.
SEE ALSO
EXTERNAL INFLUENCES
International Code Set Support
Single- and multi-byte character code sets are supported.
Hewlett-Packard Company — HP-UX Release 7.0: Sept 1989