标签:png save mic VID length har div 扫码 csharp
//超出double精准度后,如何做加法和除法
BigDecimal sumlong = BigDecimal.ZERO; BigDecimal sumlat= BigDecimal.ZERO;
for (int i = 0; i < split.length-1; i++) { String[] longlat = split[i].split(","); BigDecimal longitude = new BigDecimal(longlat[0].replace(" “, “”).replace(”\n", “”)); BigDecimal latitude = new BigDecimal(longlat[1].replace(" “, “”).replace(”\n", “”)); sumlong = sumlong.add(longitude); sumlat = sumlat.add(latitude); 1 2 } BigDecimal longitude=sumlong.divide(new BigDecimal(split.length-1)); BigDecimal latitude=sumlat.divide(new BigDecimal(split.length-1)); 1 2 if(station != null){ String[] longlat = shapeStr.split(","); if(longitude !=null && latitude !=null){ station.setLongitude(longitude.toString()); station.setLatitude(latitude.toString()); 1 2 } station.setOid(stationOid); tStationInfoRepository.save(station); }
更多java、大数据学习面试资料,请扫码关注我的公众号:
标签:png save mic VID length har div 扫码 csharp
原文地址:https://www.cnblogs.com/javaydsj/p/14854131.html