• Converts a NumLike value to a hexadecimal string.

    Parameters

    • val: NumLike

      The value to convert, which can be a string, number, bigint, or HexLike.

    Returns Hex

    A Hex string representing the numeric value.

    const hex = numToHex(12345); // Outputs "0x3039"