mirror of
https://github.com/fzaninotto/Faker.git
synced 2025-03-19 06:49:50 +01:00
Added latitude and longitude formatters to Address provider
This commit is contained in:
parent
769817a3a1
commit
5b572724c6
@ -83,6 +83,8 @@ Each of the generator properties (like `name`, `address`, and `lorem`) are calle
|
||||
postcode // '17916'
|
||||
address // '8888 Cummings Vista Apt. 101, Susanbury, NY 95473'
|
||||
country // 'Falkland Islands (Malvinas)'
|
||||
latitude // '77.147489'
|
||||
longitude // '86.211205'
|
||||
|
||||
### `Faker\Provider\en_US\PhoneNumber`
|
||||
|
||||
|
@ -99,4 +99,19 @@ class Address extends \Faker\Provider\Base
|
||||
return static::randomElement(static::$country);
|
||||
}
|
||||
|
||||
/**
|
||||
* @example '77.147489'
|
||||
*/
|
||||
public static function latitude()
|
||||
{
|
||||
return number_format(mt_rand(-180000000, 180000000)/1000000, 6);
|
||||
}
|
||||
|
||||
/**
|
||||
* @example '86.211205'
|
||||
*/
|
||||
public static function longitude()
|
||||
{
|
||||
return number_format(mt_rand(-180000000, 180000000)/1000000, 6);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user