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

> Formater un nombre avec un formatage sensible à la locale

## Présentation

La transformation `format-number` formate un nombre selon le style, la locale et les options de décimales spécifiés.

## Syntaxe

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

## Paramètres

| Paramètre    | Type   | Requis | Description                                                                           |
| ------------ | ------ | ------ | ------------------------------------------------------------------------------------- |
| `variable`   | number | Oui    | Le nombre à formater                                                                  |
| `style`      | string | Oui    | Style de formatage : `"decimal"`, `"percent"` ou `"unit"`                             |
| `unit`       | string | Non    | L'unité à utiliser lorsque le style est `"unit"` (par ex. `"kilometer"`, `"celsius"`) |
| `locale`     | string | Non    | La locale de formatage (par ex. `"en-US"`, `"fr-FR"`). Par défaut `"en-US"`           |
| `minDecimal` | number | Non    | Nombre minimum de décimales                                                           |
| `maxDecimal` | number | Non    | Nombre maximum de décimales                                                           |

## Exemples

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