hexToNumber

Converts a hexadecimal string to a number.

Example

import { hexToNumber } from "thirdweb/utils";
const number = hexToNumber("0x1a4");
console.log(number); // 420
function hexToNumber(hex: `0x${string}`, opts: Options): number;

Parameters

The hexadecimal string to convert.

Type

let hex: `0x${string}`;

Optional options for the conversion.

Type

let opts: Options;

Returns

let returnType: number;

The converted number.