# `NeoFaker.Address`
[🔗](https://github.com/muzhawir/neo_faker/blob/main/lib/neo_faker/address.ex#L1)

Functions for generating random address data.

Provides utilities to generate street names, city names, country names, building numbers, and
geographic coordinates with support for multiple locales.

# `building_number`
*since 0.12.0* 

```elixir
@spec building_number(Range.t()) :: String.t()
```

Generates a random building number within the given `range`, as a string.

`range` defaults to `1..100`. Call `String.to_integer/1` yourself if you need an integer.

## Examples

    iex> NeoFaker.Address.building_number()
    "42"

    iex> NeoFaker.Address.building_number(1..100)
    "25"

# `city`
*since 0.12.0* 

```elixir
@spec city(keyword()) :: String.t()
```

Generates a random city name.

The city name is selected from locale-specific data. See the
[available locales](https://hexdocs.pm/neo_faker/locales.html) for supported codes.

## Options

  * `:locale` (atom) - the locale to use. Defaults to the application's configured locale.

## Examples

    iex> NeoFaker.Address.city()
    "Saint Marys City"

    iex> NeoFaker.Address.city(locale: :id_id)
    "Palu"

# `coordinate`
*since 0.12.0* 

```elixir
@spec coordinate(keyword()) :: {float(), float()}
```

Generates a random `{latitude, longitude}` coordinate pair.

For a single component, use `latitude/1` or `longitude/1`.

## Options

  * `:precision` (non-negative integer) - the number of decimal places. Defaults to `6`.

## Examples

    iex> NeoFaker.Address.coordinate()
    {11.5831672, 165.3662683}

    iex> NeoFaker.Address.coordinate(precision: 2)
    {11.58, 165.37}

# `country`
*since 0.12.0* 

```elixir
@spec country(keyword()) :: String.t()
```

Generates a random country name.

The country name is selected from locale-specific data. See the
[available locales](https://hexdocs.pm/neo_faker/locales.html) for supported codes.

## Options

  * `:locale` (atom) - the locale to use. Defaults to the application's configured locale.

## Examples

    iex> NeoFaker.Address.country()
    "United States"

    iex> NeoFaker.Address.country(locale: :id_id)
    "Amerika Serikat"

# `latitude`
*since 0.12.0* 

```elixir
@spec latitude(keyword()) :: float()
```

Generates a random latitude between `-90.0` and `90.0`.

## Options

  * `:precision` (non-negative integer) - the number of decimal places. Defaults to `6`.

## Examples

    iex> NeoFaker.Address.latitude()
    11.5831672

    iex> NeoFaker.Address.latitude(precision: 4)
    11.5832

# `longitude`
*since 0.12.0* 

```elixir
@spec longitude(keyword()) :: float()
```

Generates a random longitude between `-180.0` and `180.0`.

## Options

  * `:precision` (non-negative integer) - the number of decimal places. Defaults to `6`.

## Examples

    iex> NeoFaker.Address.longitude()
    165.3662683

    iex> NeoFaker.Address.longitude(precision: 4)
    165.3663

---

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