Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.qu.ai/llms.txt

Use this file to discover all available pages before exploring further.

function formatUnits(value, unit?): string
Converts value into a decimal string, assuming unit decimal places. The unit may be the number of decimal places or the name of a unit (e.g. "gwei" for 9 decimal places).

Parameters

ParameterTypeDescription
valueBigNumberishThe value to convert.
unit?string | NumericThe unit to convert to. Default is 18

Returns

string The converted value.

Throws

If the unit is invalid.

Source

utils/units.ts:33