Convert Value to Unsigned Integer 16 Method
The Convert Value to Unsigned Integer 16 method converts the value that the value argument contains to an integer in the range of 0 through 2
16
minus 1. The nonexponential value is 0 through 65,535. It returns a value depending on which of the following values the value argument contains:
NaN. It returns the following value:
+0
+0. It returns the following value:
0
POSITIVE_INFINITY. It returns the following value:
Infinity
Any other value. It returns the absolute value of the integer part of the number, rounded toward 0. The absolute value does not include a positive sign or a negative sign.
This method is unique to Siebel eScript. For more information, see Make Sure the JavaScript Interpreter Can Run a Function.
This method uses the same argument as the Convert Value to Integer 32 method. For more information, see Convert Value to Integer 32 Method.
Format
ToUint16(value)
To avoid an error, you must first pass the value argument to the Is NaN method or to the Convert Value to Number method. To use the Convert Value to Number method, you can include a statement that uses the following format:
var x;i
x = toNumber(value);
(if x == 'NaN')
.
. [error -handling statements];
.
else
ToUint16(value);
The Convert Value to Unsigned Integer 16 method truncates rather than rounds the value it receives, so it rounds numbers toward 0. For example, it rounds 12.88 to 12.
Related Topics
For more information, see the following topics: