Docs

toUnits

Converts a string representation of a number with decimal places to a BigInt representation.

Example

import { toUnits } from "thirdweb/utils";
toUnits("1", 18);
// 1000000000000000000n

Parameters

Returns

The BigInt representation of the number.