# `SefazDanfe.Format`
[🔗](https://github.com/devaction-labs/sefaz_danfe/blob/v0.1.0/lib/sefaz_danfe/format.ex#L1)

The Brazilian presentation of the values of a DANFE: tax ids, CEP, dates, money, quantities and
the access key. Every function takes what the XML holds (text, `nil` when absent) and answers
text, or `nil` when there is nothing to show, so a missing field stays blank.

# `access_key`

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

The 44 digits of an access key in groups of four.

# `date`

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

The date of an ISO 8601 date or date-time as `dd/mm/yyyy`, as the issuer wrote it (no zone shift).

# `datetime`

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

An ISO 8601 date-time as `dd/mm/yyyy HH:MM:SS`.

# `money`

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

A decimal as money: two places, `.` for thousands and `,` for decimals (`1.234,50`).

# `number`

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

The number of the document as `000.000.001` (9 digits in groups of three).

# `percent`

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

A rate as a percentage with 2 to 4 places (`12.0000` is `12,00`).

# `phone`

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

A phone as `(00) 0000-0000` or `(00) 00000-0000` when it has the area code, as is otherwise.

# `quantity`

```elixir
@spec quantity(String.t() | nil, pos_integer()) :: String.t() | nil
```

A decimal with at least 2 places and the ones that matter up to `max` (default 10), as quantities
and unit prices are written (`10.0000` is `10,00`; `25.1234500000` is `25,12345`).

# `series`

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

The series of the document with 3 digits (`001`).

# `tax_id`

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

A CNPJ (digits or letters, 14) as `00.000.000/0000-00`, a CPF (11) as `000.000.000-00`.

# `time`

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

The time of an ISO 8601 date-time as `HH:MM:SS`, as the issuer wrote it.

# `zip`

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

A CEP as `00000-000`.

---

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