|
|
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:
Value | Meaning |
0 | Successful |
1 | *NLS not installed |
2 | *Specified language not configured |
3 | Invalid length specified (inlength or
outlength) |
4 | Invalid number specified (instring) |
5 | *NLS internal error |
6 | *NLS internal error |
7 | Truncation occurred (outstring
partially formatted) |
8 | Invalid numspec parameter |
9 | Invalid 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.
Bits | Value | Meaning |
15:1 | 0 | Convert thousands separators |
| 1 | Strip thousands separators |
14:1 | 0 | Convert decimal separators |
| 1 | Strip decimal separators |
13:1 | 0 | Any character can be in
instring (no validation as a number is
performed) |
| 1 | Number contained in instring
(no validation as a number is performed) |
0:13 | Reserved 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
|