【发布时间】:2010-10-18 09:22:44
【问题描述】:
我有一个像这样的pojo:
public class LocationPoint {
protected double la;
protected double lo;
public double getLat() {
return la;
}
public void setLat(double value) {
this.la = value;
}
public double getLong() {
return lo;
}
public void setLong(double value) {
this.lo = value;
}
}
场景: 在 MapView 活动上做某事后,我回到了名为 id 的活动
if (resultCode == RESULT_OK) {
int latitude = data.getIntExtra("Latitude", 0);
int longitude = data.getIntExtra("Longitude", 0);
if (latitude!=0 && longitude!=0)
{
LocationPoint p = new LocationPoint();
p.setLat((double) latitude);
p.setLong((double) longitude);
}
int 纬度 = 43802334 和 int 经度 = 24825592 p中转换后的值为:4.3802334E7和2.4825592E7
我希望双精度值没有 E7,因为 Web 服务会因此引发错误。我做错了什么,不明白为什么。你能给个建议吗?谢谢
【问题讨论】: