> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://v3.viem.sh/api/mcp` to find what you need.

# AbiFunction.format

:::info
`AbiFunction.format` is a re-export of ox's [`AbiFunction.format`](https://oxlib.sh/api/AbiFunction/format). Refer to the ox documentation for the full reference.
:::

Formats an [`AbiFunction.AbiFunction`](/docs/utilities/abifunction/types#abifunction) into a **Human Readable ABI Function**.

## Imports

```ts
import { AbiFunction } from 'viem/utils'
```

## Examples

```ts twoslash
// @noErrors
import { AbiFunction } from 'viem/utils'

const formatted = AbiFunction.format({
  type: 'function',
  name: 'approve',
  stateMutability: 'nonpayable',
  inputs: [
    {
      name: 'spender',
      type: 'address'
    },
    {
      name: 'amount',
      type: 'uint256'
    }
  ],
  outputs: [{ type: 'bool' }]
})

formatted
//    ^?
```

## Definition

```ts
function format<abiFunction>(
  abiFunction: abiFunction | AbiFunction,
): format.ReturnType<abiFunction>
```

## Parameters

### abiFunction

* **Type:** `abiFunction | AbiFunction`

The ABI Function to format.

## Return Type

The formatted ABI Function.

`format.ReturnType<abiFunction>`
