Docs

toTokens

Converts a given number of units to a string representation with a specified number of decimal places.

Example

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

Parameters

Returns

The string representation of the converted units.