|
@@ -37,6 +37,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.text.DecimalFormat;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
@@ -491,9 +492,9 @@ public class UserLogic {
|
|
|
Math.cos(lat1Rad) * Math.cos(lat2Rad) *
|
|
|
Math.sin(deltaLon / 2) * Math.sin(deltaLon / 2);
|
|
|
double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
|
|
|
-
|
|
|
+ DecimalFormat df = new DecimalFormat("#.00");
|
|
|
// 返回距离(单位:公里)
|
|
|
- return EARTH_RADIUS * c;
|
|
|
+ return Convert.toDouble(df.format((EARTH_RADIUS * c)));
|
|
|
}
|
|
|
|
|
|
|