哪个dataType将返回值(37.961498),因为它是?哪个dataType将返回值(37.961498),因为它是?双重无效
我正在MapView中工作。其中,目前我正在设置注释,因此我必须设置CLLocationCoordinate2DMake,并从googleAPI解析出一些lat和lng(例如:lat =“37.9615000”和lng =“60.5566000”)。我有字符串中的值,因此我将sting转换为double,然后分配。但它没有帮助。请有人帮助我。
double int1=[num1s floatValue];
double int2=[num2s floatValue];
NSLog(@" %f %f ",int1,int2);
annotation.coordinate=CLLocationCoordinate2DMake(int1, int2);
实际值是:37.9615000,60.5566000 值我的NSLog得到:37.961498,60.556599
在此先感谢。
更多的解释和理由,为什么我需要确切值:
我需要为中国设置注释凭借其经纬度和LAN(LAT = “53.5609740”; LNG = “134.7728099”)
不过,虽然从字符串转换再次值更改
[每台计算机科学家应该知道浮点运算什么(http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html) –
NSString ....... –
顺便问一句,你的问题是什么?为什么你需要确切的结果? –