View Source AddressUS (AddressUS v0.4.2)

Summary

Functions

Abbreviates the state provided.

Converts the country to the 2 digit ISO country code. "US" is default.

Functions

Link to this function

abbreviate_state(raw_state)

View Source

Abbreviates the state provided.

Example

iex> AddressUS.abbreviate_state("Wyoming")
"WY"
iex> AddressUS.abbreviate_state("wyoming")
"WY"
iex> AddressUS.abbreviate_state("Wyomin")
"Wyomin"
iex> AddressUS.abbreviate_state(nil)
nil
Link to this function

get_country_code(country_name)

View Source

Converts the country to the 2 digit ISO country code. "US" is default.

Example

iex> AddressUS.Parser.get_country_code(nil)
"US"
iex> AddressUS.Parser.get_country_code("Afghanistan")
"AF"
iex> AddressUS.Parser.get_country_code("AF")
"AF"