numberToHex

Converts a number or bigint to a hexadecimal string.

Example

import { numberToHex } from "thirdweb/utils";
const hex = numberToHex(420);
console.log(hex); // "0x1a4"

Parameters

Returns

The hexadecimal representation of the input value.