# (atoi string) [GstarCAD 2012](../../../Index.md) → [Developer Reference](../../%28Developer%20Reference%29.md) → [AutoLISP Reference](../%28AutoLISP%20Reference%29.md) → [LISP Functions](%28LISP%20Functions%29.md) <!-- help-structure:notice --> > **Source status:** This source topic has 1 recorded inherited issue(s). [Source issue details](../../../Source%20Issues.md). <!-- /help-structure:notice --> <a id="132"></a> ## (atoi string) --- Convert the string to an integer. --- The **atoi** function converts a *string* into an [integer](../../../Source%20Issues.md#issue-e9401fea76b0d249). If the *string* contains numbers after the decimal point, it truncates them. This command returns 0 if the text of the *string* is not recognizable as a number. ### Examples | Code | Returns | | --- | --- | | (**atoi** "-25") | -25 | | (**atoi** "37.8") | 37 | | (**atoi** "Hello") | 0 | **Tell me about...** [(angtof string \[mode\])](%28angtof%20string%20-mode-%29.md) [(ascii string)](%28ascii%20string%29.md) [(atof string)](IDR_LISP_B131.md) [(chr integer)](%28chr%20integer%29.md) [LISP Compatibility](../LISP%20Compatibility.md) [Programming Overview of LISP (LISt Processing) Language](../Programming%20Overview%20of%20LISP%20%28LISt%20Processing%29%20Language.md) <a id="holding"></a> ## Other versions with matching text [GstarCAD 2011](../../../../2011/Developer%20Reference/AutoLISP%20Reference/LISP%20Functions/%28atoi%20string%29.md)