# AbiFunction.format

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

## Imports

:::code-group
```ts [Named]
import { AbiFunction } from 'ox'
```

```ts [Entrypoint]
import * as AbiFunction from 'ox/AbiFunction'
```
:::

## Examples

```ts twoslash
import { AbiFunction } from 'ox'

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>
```

**Source:** [src/core/AbiFunction.ts](https://github.com/wevm/ox/blob/main/src/core/AbiFunction.ts#L1095)

## Parameters

### abiFunction

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

The ABI Function to format.

## Return Type

The formatted ABI Function.

`format.ReturnType<abiFunction>`
