---
url: >-
  https://adk.nht.io/api/@nhtio/adk/batteries/tools/formatting/variables/formatNumberTool.md
description: Format a number using locale-aware styles.
---

# Variable: formatNumberTool

```ts
const formatNumberTool: Tool<SpooledArtifact>;
```

Defined in: [batteries/tools/formatting/index.ts:24](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/batteries/tools/formatting/index.ts#L24)

Format a number using locale-aware styles.

## Remarks

Supported styles: `decimal`, `currency`, `percent`, `compact` (e.g. `1.2K`), `scientific`
(e.g. `1.2e+3`), and `ordinal` (`1st`, `2nd`, `3rd`). Uses `Intl.NumberFormat` and
`Intl.PluralRules` from the JS standard library. Returns an error string for non-finite values
or invalid currency-without-currency-code.
