> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Integer

> Integers are positive and negative whole 32-bit unsigned numbers without decimals. If you need to work with decimals, use the Float data type.

Integers are positive and negative whole 32-bit unsigned numbers without decimals. If you need to work with decimals, use the Float data type.

## Constructors

### Integer()

```crmscript theme={null}
Integer Integer()
```

Default constructor.

### Integer(Integer)

```crmscript theme={null}
Integer Integer(Integer value)
```

Pass a value to copy into a new object.

### Integer(String)

```crmscript theme={null}
Integer Integer(String value)
```

Pass a String containing a number. The constructor will parse the text and create an Integer object.

## Methods

## toString()

Converts a numeric value to its string representation.

One of the most frequently used methods, typically when you are going to output something.

```crmscript theme={null}
String toString()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String)

**Example:**

```crmscript theme={null}
Integer c = 100;
String s = c.toString();
```

## toBool()

Converts a numeric value to its boolean representation. Returns false if the integer is zero, otherwise true.

```crmscript theme={null}
Bool toBool()
```

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool)

**Example:**

```crmscript theme={null}
Integer i = 3;
printLine(i.toBool().toString());
```

## abs()

Converts a numeric value to its absolute value (the non-negative value of the number without regarding the sign).

One of the most frequently used methods, typically when you are going to output something.

```crmscript theme={null}
Integer abs()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer)

**Example:**

```crmscript theme={null}
Integer i = -7;
print(i.abs().toString());
```

## toHex()

Converts an Integer to a hexadecimal string.

```crmscript theme={null}
String toHex()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String)

<Note>
  By default, it converts the value of the current object. You can optionally pass a specific value to convert. (See below)
</Note>

**Example:**

```crmscript theme={null}
printLine("Int \\t Hex");
for (Integer i = 0; i < 16; i++) {
\tprintLine(i.toString() +"\\t " + i.toHex());
}
```

## toHex(Integer)

Converts an Integer to a hexadecimal string.

Same as above except you write toHex(i) rather than i.toHex().

```crmscript theme={null}
String toHex(Integer)
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String)

## isNull()

Returns true if it has no value and false if it does.

```crmscript theme={null}
Bool isNull()
```

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool)

<Note>
  A NULL/NUL/NIL Integer is different from zero, in that it is conceptually without a value. However, when a null Integer is used naively, CRMScript is usually forgiving and interprets it as zero.
</Note>

**Example:**

```crmscript theme={null}
Integer i;
printLine(i.isNull().toString());
i = 0;
printLine(i.isNull().toString());
```


## Related topics

- [Integer data type](/en/automation/crmscript/datatypes/integer-type.md)
- [Numbers (integer, decimal, float)](/en/api/search/odata/numbers.md)
- [Bool data type](/en/automation/crmscript/datatypes/bool-type.md)
- [DateTime](/en/automation/crmscript/reference/CRMScript.Global.DateTime.md)
- [Add Remove Contact Selection Member Interests](/en/api/reference/restful/agent/selection_agent/add-remove-contact-selection-member-interests.md)
- [Update Interests](/en/api/reference/restful/agent/contact_agent/update-interests.md)
