# `PhoenixKit.Utils.Number`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.87/lib/phoenix_kit/utils/number.ex#L1)

Number formatting utilities for PhoenixKit.

Provides functions for formatting numbers with thousand separators,
abbreviations, and other common number formatting needs.

# `format`

```elixir
@spec format(integer() | nil) :: String.t()
```

Formats a number with thousand separators.

## Examples

    iex> PhoenixKit.Utils.Number.format(1234567)
    "1,234,567"

    iex> PhoenixKit.Utils.Number.format(0)
    "0"

    iex> PhoenixKit.Utils.Number.format(nil)
    "0"

# `format_percentage`

```elixir
@spec format_percentage(float() | integer() | nil) :: String.t()
```

Formats a number as a percentage.

## Examples

    iex> PhoenixKit.Utils.Number.format_percentage(95.5)
    "95.5%"

    iex> PhoenixKit.Utils.Number.format_percentage(100)
    "100%"

    iex> PhoenixKit.Utils.Number.format_percentage(nil)
    "0%"

# `format_short`

```elixir
@spec format_short(integer() | nil) :: String.t()
```

Formats a number with abbreviations (K, M, B).

## Examples

    iex> PhoenixKit.Utils.Number.format_short(1_234_567)
    "1.2M"

    iex> PhoenixKit.Utils.Number.format_short(5_432)
    "5.4K"

    iex> PhoenixKit.Utils.Number.format_short(123)
    "123"

---

*Consult [api-reference.md](api-reference.md) for complete listing*
