Skip to main content

Try it Live

Run Uint examples in the interactive playground

    Radix Support

    Decimal (base 10)

    Uint.toString(Uint(12345n))  // "12345"
    

    Hexadecimal (base 16)

    Uint.toString(Uint(255n), 16)  // "ff" (no 0x prefix)
    
    For hex with 0x prefix, use toHex() instead.

    Binary (base 2)

    Uint.toString(Uint(15n), 2)  // "1111"
    

    Octal (base 8)

    Uint.toString(Uint(64n), 8)  // "100"
    

    See Also

    • toHex - Convert to hex (with 0x prefix)
    • toBigInt - Convert to BigInt