# format_diff_stats

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/tui/widgets/diff/format_diff_stats)

Format addition/deletion counts as styled `+N -M` content.

Takes the pair as a `DiffStats` rather than two ints so the counts cannot be
transposed on the way to the places the user reads them — the `DiffMessage`
header and the approval prompt's `File:` header.

## Signature

```python
format_diff_stats(
    stats: DiffStats,
) -> Content
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `stats` | `DiffStats` | Yes | Line counts for the change. |

## Returns

`Content`

Styled content, empty when both counts are zero.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/4bfa52000ef65ac623d8ada0cb67f67cbdd663ea/libs/code/deepagents_code/tui/widgets/diff.py#L728)