View Source Faker.Phone.PtBr (Faker v0.18.0)

Function to generate Brazilian phone numbers.

Summary

Functions

Pick a random region code from list

Replace 'xx' for a random region number picked.

Returns a random phone number.

Functions

@spec generate_region_code() :: binary()

Pick a random region code from list

Examples

iex> Faker.Phone.PtBr.generate_region_code()
"92"
iex> Faker.Phone.PtBr.generate_region_code()
"31"
iex> Faker.Phone.PtBr.generate_region_code()
"71"
iex> Faker.Phone.PtBr.generate_region_code()
"71"
Link to this function

number_with_region(number)

View Source
@spec number_with_region(binary()) :: binary()

Replace 'xx' for a random region number picked.

Examples

iex> Faker.Phone.PtBr.number_with_region("(xx) 9 1542-6461")
"(92) 9 1542-6461"
iex> Faker.Phone.PtBr.number_with_region("(xx) 4329-7052")
"(31) 4329-7052"
iex> Faker.Phone.PtBr.number_with_region("(xx) 9 7020-3032")
"(71) 9 7020-3032"
iex> Faker.Phone.PtBr.number_with_region("(xx) 5733-7603")
"(71) 5733-7603"
@spec phone() :: binary()

Returns a random phone number.

Examples

iex> Faker.Phone.PtBr.phone()
"(75) 9 1542-6461"
iex> Faker.Phone.PtBr.phone()
"(75) 4329-7052"
iex> Faker.Phone.PtBr.phone()
"(69) 9 7020-3032"
iex> Faker.Phone.PtBr.phone()
"(75) 5733-7603"