We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
// 使经纬度值偏移 function skew($a){ $num = floatval ($a); $num += floatval('0.00000'.rand(0,9)); // 添加随机数 $str = strval($num); // 设置为小数点6位 $dian = explode('.',$str)[1]; $len = 6-strlen($dian); if(0 != $len){ if(0 > $len){ // 去除多余的小数 $str = str_split($str,strlen($str)+$len)[0]; }else{ // 精度不够,在后面用 0 补位 $str .= implode("0",array_pad([],$len+1,'')); } } return $str; } // 微调经纬度 $longitude = skew(env('MOGUDING_LONGITUDE', '')); $latitude = skew(env('MOGUDING_LATITUDE', ''));
The text was updated successfully, but these errors were encountered:
为什么要浮动,请问现在代码还可以用吗
Sorry, something went wrong.
No branches or pull requests
The text was updated successfully, but these errors were encountered: