HPlogo MPE/iX Intrinsics Reference Manual > Chapter 9 Command Definitions (MAIL-PUTJCW)

NLCONVNUM

MPE documents

Complete PDF
Table of Contents
Index

Edition 7 E0701 ♥
Edition 7 E0300
Edition 6 E0195

NM and CM callable.

Converts native language numbers with native decimal and thousands separators to an ASCII number with NATIVE-3000 decimal and thousands separators. Optionally, the decimal and thousands separators can be removed.

Syntax



             I16V     CA        I16V      CA         I16V
  NLCONVNUM (langnum, instring, inlength, outstring, outlength,
             U16V   U16V     U16V     U16V      O-V
             error, numspec, fmtmask, decimals);

Parameters


langnum

16-bit signed integer by value (required)

Contains the language ID number, specifying which numeric formatting rules are to be used in the conversion.

instring

character array (required)

Contains the native language formatted number to be converted. Leading and trailing spaces are ignored.

inlength

16-bit signed integer by value (required)

Passes the length, in bytes, of instring.

outstring

character array (required)

Contains the converted output, left justified in the buffer. Outstring can reference the same address as instring.

outlength

16-bit signed integer by value (required)

Passes the length, in bytes, of outstring. If the call is successful, outlength contains the actual length of the converted number.

error

16-bit unsigned integer by value (required)

Returns two elements: the first element is the error number; the second element is reserved and always returns 0. The possible error number values are:

ValueMeaning
0Successful
1*NLS not installed
2*Specified language not configured
3Invalid length specified (inlength or outlength)
4Invalid number specified (instring)
5*NLS internal error
6*NLS internal error
7Truncation occurred (outstring partially formatted)
8Invalid numspec parameter
9Invalid fmtmask parameter

* Does not apply to calls with a langnum equal to 0 (NATIVE3000/XL).

numspec

16-bit unsigned integer by value (optional)

Returns a byte array from NLNUMSPEC, containing format information. If this parameter is present, langnum is ignored and performance is improved (refer to NLNUMSPEC).

fmtmask

16-bit unsigned integer by value (optional)

Specifies how to format the number. The default value is 0 and indicates substitution only.

BitsValueMeaning
15:10Convert thousands separators
1Strip thousands separators
14:10Convert decimal separators
1Strip decimal separators
13:10Any character can be in instring (no validation as a number is performed)
1Number contained in instring (no validation as a number is performed)
0:13Reserved for the operating system

decimals

16-bit unsigned integer by value (optional)

If fmtmask bit 13 is set to 1, decimals returns the number of decimal places in the input number.

Operation Notes


Split-stack calls are not permitted.

This intrinsic either:
  • Converts a native language formatted number to an ASCII number with the NATIVE-3000 decimal separator (.) and thousands separator (,) for use in further conversion to INTEGER, REAL, and so on.

  • Converts the decimal and thousands separators, or strips them (see fmtmask), to the NATIVE-3000 equivalent.

For languages using an alternate set of digits (ARABIC and HINDI digits only), this intrinsic converts the digits to ASCII for recognition and use as numeric characters.

Related Information


Intrinsics NLFMTNUM, NLNUMSPEC
Manuals Native Language Programmer's Guide




NLCONVCUSTDATE


NLFINDSTR