getItemValueInteger (NotesXspDocument - JavaScript™)
Gets the value of an item as a integer.
Syntax
getItemValueInteger(name:string) : int
Parameter | Description |
---|---|
name |
The name of the item. |
Return value | Description |
---|---|
int |
The item value. |
Usage
If multiple items have the same name, this method returns the value of the first item.If the item has multiple values, this method returns the first value.
If the item does not exist, this method returns 0.
If the item is text or a date, this method returns 0.
If the item is a real number, this method truncates the fraction. A real number displays with a fraction of zero unless fixed.
Examples
This value for a computed field returns the value of the Number item in the document associated with the current XPage.var n = document1.getItemValueInteger("Number");
if(n == 0) {
return "Number is empty or doesn't exist."
} else {
return n.toFixed();
}