function _dd_generate in Geofield 7
Helper to generate DD coordinates
7 calls to _dd_generate()
File
- ./
geofield.devel_generate.inc, line 54 - Create random data to populate geofields.
Code
function _dd_generate($min, $max, $int = FALSE) {
$func = 'rand';
if (function_exists('mt_rand')) {
$func = 'mt_rand';
}
$number = $func($min, $max);
if ($int || abs($number) === 180) {
return $number;
}
$decimals = $func(1, pow(10, 5)) / pow(10, 5);
return round($number + $decimals, 5);
}