# INT() Function

YouTube: [How to Use the INT Function in Report Custom Columns?](https://www.youtube.com/watch?v=_GvxLqraYBg)

## How to Use the INT Function in Report Custom Columns?

In this tutorial, we'll learn how to design an expression using the `INT` function, which removes the decimal part of a number and returns only the integer portion.

***

### Accessing the Expression Designer:

* Open Sale Voucher or any document.
* Navigate to the "**Setup Column Attributes"**.
* Here, you'll see a list of available columns that can be used to build expressions.
* Click on **"Add/Edit Expression Columns"** where you can write your expression using predefined functions.

<figure><img src="/files/QqZlgPb7nJy0O1lsvxB5" alt=""><figcaption></figcaption></figure>

### Writing Your First Expression

* Every expression must start with the script header: **'#@LSCRIPT**

<figure><img src="/files/K37bBe9AvTCKOiLXaocU" alt=""><figcaption></figcaption></figure>

* Click the (+) Plus icon to create a new expression.
* Fill in the required fields:&#x20;
  * **Expression Name** – A unique name for your expression.
  * **Expression Type** – Choose either **Text** or **Numeric** depending on the expected output.

<figure><img src="/files/doA3qg3JF9QMdBAdMu4O" alt=""><figcaption></figcaption></figure>

* Double-click on the newly created expression to insert it into the script editor.
* Define the expression using the syntax:
  * Expression Name = INT(SALE\_RATE)

<figure><img src="/files/vfEhthuP99inskBXV6BF" alt=""><figcaption></figcaption></figure>

* Save the expression.
* Scroll down and check the box to enable the expression in the grid.

<figure><img src="/files/VDKtOxg1ybjKDsPpePG8" alt=""><figcaption></figcaption></figure>

* Save and proceed to check the effect.
* The column will now appear in the grid.

<figure><img src="/files/jSXTXqxbMCawAfoOgKRS" alt=""><figcaption></figcaption></figure>

* **Review the result:** the function will display only the **integer part** of the field value (e.g., 999.45→ 999).

***

### Applying the Expression in a Report

* Navigate to the **Reporting** section.
* Open the **Sales Register Detailed Report** or any **"Report".**
* Go to **Setup Column Attributes** as you did earlier.

<figure><img src="/files/ZcTAZgEDaVTI9vCTm3sn" alt=""><figcaption></figcaption></figure>

* Before adding the expression to the report, go to **Other Settings**.
* Ensure the **Script Editor** is set to **VBScript**.

<figure><img src="/files/US8rZzar6siLdptkuOMX" alt=""><figcaption></figcaption></figure>

* Click **Save**.
  * *Note: VBScript is the default for new configurations but always verify this setting.*

***

### Adding and Using the Expression in the Report

* Return to **"Setup Column Attribute"** window.
* Click **"Add/Edit Expression Columns"**.
* Every expression must start with the script header **'#@LSCRIPT**

<figure><img src="/files/SNQZOJSRApDSLCd6BKsD" alt=""><figcaption></figcaption></figure>

* Click the (+) Plus icon to create a new expression.
* Fill in the required fields:&#x20;
  * **Expression Name** – A unique name for your expression.
  * **Expression Type** – Choose either **Text** or **Numeric** depending on the expected output.

<figure><img src="/files/KCzK7pI1xHKvk4LhAdHz" alt=""><figcaption></figcaption></figure>

* Double-click the expression name to insert it into the editor.
* Define the expression using the syntax:
  * Expression Name = INT( RATE\_PACK)

<figure><img src="/files/qv2OBBJHy2EN2HChmpmN" alt=""><figcaption></figcaption></figure>

* Save the expression.
* Scroll down and check the box to enable the expression in the grid.

<figure><img src="/files/y1QHOX2ea0OCsDDZy5aW" alt=""><figcaption></figcaption></figure>

* Save and proceed to check the effect.
* **Refresh the report** to view the final result.

<figure><img src="/files/V7h79cLmHDmLJAMfum8M" alt=""><figcaption></figcaption></figure>

***

### Output:

* The column will now show only the **integer portion** of the specified field.
* Example: if the sale rate is 2350.82, the `INT` function will return 2350.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/defining-custom-columns-in-reports-and-grids-with-expressions/int-function.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
