<!--
{
  "availability" : [

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

# toNumber

Converts a supported numeric type to a JavaScript number.

```
static number toNumber();
```

## Parameters

`value`

A numeric value to convert or validate.

## Discussion

If the value passed in isn’t a number, this function throws `ValueNotNumericError`. If the value is numeric but can’t be represented by a JavaScript number, it throws `ValueNotInNumberRangeError`.

```javascript
import { toNumber } 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)