Skip to content

Value.formatGwei

Formats a bigint Value (default: wei) to a string representation of Gwei.

Imports

Named
import { Value } from 'ox'

Examples

import { Value } from 'ox'
 
Value.formatGwei(1_000_000_000n)
'1'

Definition

function formatGwei(
  wei: bigint,
  unit?: 'wei',
): string

Source: src/Value.ts

Parameters

wei

  • Type: bigint

The Value to format.

unit

  • Type: 'wei'
  • Optional

The unit to format the Value in.

Return Type

The Gwei string representation of the Value.

string