<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "CKToolJS",
  "identifier" : "/documentation/CKToolJS/CKToolDatabaseModule/toInt64",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "CKTool JS"
    ],
    "preciseIdentifier" : "clm/CKToolDatabaseModule/toInt64"
  },
  "title" : "toInt64"
}
-->

# toInt64

Converts a number or numeric string to a `Int64`.

```
static Int64 toInt64();
```

## Parameters

`value`

A numeric or numeric string to convert or validate.

## Return Value

If the value passes validation, this function returns a `Int64`; otherwise it throws `ValueNotInt64Error`. A numeric value passes validation if it’s within signed 64-bit integer range. `toInt64` can accept a numeric string that represents a number that requires more precision than can be achieved with a JavaScript number.

## Discussion

In TypeScript, `Int64` is a branded `BigNumber` type. In JavaScript, it’s a `BigNumber`. `BigNumber` is from the bignumber.js package.

```javascript
import { toInt64 } from "@apple/cktool.database";
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)