> ## Documentation Index
> Fetch the complete documentation index at: https://docs.reelevant.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Format Number

> Format a number with locale-aware formatting

## Overview

The `format-number` transformation formats a number according to the specified style, locale, and decimal options.

## Syntax

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
format-number(<variable>, style="decimal")
```

## Parameters

| Parameter    | Type   | Required | Description                                                                   |
| ------------ | ------ | -------- | ----------------------------------------------------------------------------- |
| `variable`   | number | Yes      | The number to format                                                          |
| `style`      | string | Yes      | Formatting style: `"decimal"`, `"percent"`, or `"unit"`                       |
| `unit`       | string | No       | The unit to use when style is `"unit"` (e.g., `"kilometer"`, `"celsius"`)     |
| `locale`     | string | No       | The locale for formatting (e.g., `"en-US"`, `"fr-FR"`). Defaults to `"en-US"` |
| `minDecimal` | number | No       | Minimum number of decimal places                                              |
| `maxDecimal` | number | No       | Maximum number of decimal places                                              |

## Examples

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
format-number(<variable>, style="decimal", locale="fr-FR")
format-number(<variable>, style="percent", minDecimal=1, maxDecimal=2)
format-number(<variable>, style="unit", unit="kilometer", locale="en-US")
```
