Converts a decimal number to hexadecimal representation (base 16).

const hex1 = Chalkboard.numb.toHexadecimal(26); // Returns "1a"
const hex2 = Chalkboard.numb.toHexadecimal(26, true, true); // Returns "0x1A"
  • Parameters

    • num: number

      The decimal number

    • Optionalprefix: boolean = false

      Whether to include "0x" prefix (optional, defaults to false)

    • Optionaluppercase: boolean = false

      Whether to use uppercase letters (optional, defaults to false)

    Returns string