标签:经纬度 tostring ble print long array parse odm new
public static String DDtoDMS(Double d){ String[] array=d.toString().split("[.]"); String degrees=array[0];//得到度 Double m=Double.parseDouble("0."+array[1])*60; String[] array1=m.toString().split("[.]"); String minutes=array1[0];//得到分 Double s=Double.parseDouble("0."+array1[1])*60; String[] array2=s.toString().split("[.]"); String seconds=array2[0];//得到秒 return degrees+"-"+minutes+"-"+seconds; } @Test public void h(){ Double longi = new Double(33.14898745000000000000); System.out.println(Test2.DDtoDMS(longi)); }
标签:经纬度 tostring ble print long array parse odm new
原文地址:https://www.cnblogs.com/zplogo/p/9373987.html