1
0
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:
Tiago Ribeiro 2012-06-25 18:02:46 +01:00
parent 769817a3a1
commit 5b572724c6
2 changed files with 17 additions and 0 deletions

View File

@ -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`

View File

@ -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);
}
}