---
title: "gsql_to_int()"
component: "gsql-ref"
version: "3.10"
module: "ddl-and-loading"
html_url: "/gsql-ref/3.10/ddl-and-loading/functions/token/gsql_to_int"
canonical_url: "https://www.tigergraph.com/docs/gsql-ref/3.10/ddl-and-loading/functions/token/gsql_to_int"
markdown_url: "https://www.tigergraph.com/docs/gsql-ref/3.10/ddl-and-loading/functions/token/gsql_to_int.md"
---

[View as HTML](https://www.tigergraph.com/docs/gsql-ref/3.10/ddl-and-loading/functions/token/gsql_to_int)

# gsql_to_int()

Converts the string representation of an integer into an integer.

* If the input string is the string representation of an int, the function returns that integer.
* If the input string is the string representation of a float, the function returns that number cast as an integer.

## Syntax

`gsql_to_int(in_string)`

## Parameters

in\_string

The string representation of an integer.

## Return type

`INT`

## Example

gsql_to_int("120") -> 120
gsql_to_int("-123") -> -123
