---
url: >-
  /statelake/scripting-reference/functions-and-procedures/conversion-functions/strtoint64.md
---

# StrToInt64

**StrToInt64** converts a **String** into an **Int64** data type.

Please review [Integer (Integer, Cardinal, Int64)](/statelake/scripting-reference/data-types/integer-integer-cardinal-int64-longint) for additional information about the **Int64** data type.

If the **String** does not contain a **Integer** (such as a number including decimals), then the value will cause an error, and the **Action** will fail.

You could use a **Try...Except** block to handle the error and provide a default value.

Declaration: Function StrToInt64( const S : string) : Integer;

An example follows.

```pascal
procedure OnMapEvent(var Value:Variant);
var
  MyAmount : String;
begin
  MyAmount := '12345678912345678';
 //Value will be equal to 12345678912345678
  Value := StrToInt64(MyAmount);
end;
```
