# `Benchee.Conversion.Format`
[🔗](https://github.com/bencheeorg/benchee/blob/1.5.1/lib/benchee/conversion/format.ex#L1)

Functions for formatting values and their unit labels. Different domains
handle this task differently, for example durations and counts.

See `Benchee.Conversion.Count` and `Benchee.Conversion.Duration` for examples.

# `format`

```elixir
@callback format(number()) :: String.t()
```

Formats a number as a string, with a unit label. See `Benchee.Conversion.Count`
and `Benchee.Conversion.Duration` for examples

# `format_human`

```elixir
@callback format_human(number()) :: String.t()
```

Formats in a more "human" way, one biggest unit at a time.

So instead of 1.5h it says 1h 30min

# `format`

Formats a unit value in the domain described by `module`. The module should
provide a `units/0` function that returns a Map like

    %{ :unit_name => %Benchee.Conversion.Unit{ ... } }

Additionally, `module` may specify a `separator/0` function, which provides a
custom separator string that will appear between the value and label in the
formatted output. If no `separator/0` function exists, the default separator
(a single space) will be used.

    iex> format({1.0, :kilobyte}, Benchee.Conversion.Memory)
    "1 KB"

# `format`

# `format`

Formats a unit value with specified label and separator

# `format_human`

Human friendly duration format for time as a string.

The output is a sequence of values and unit labels separated by a space.
Only units whose value is non-zero are included in the output.
The passed number is duration in the base unit - nanoseconds.

