问题描述
哪个dataType会返回值(37.961498)?
Which dataType will return the value (37.961498) as it is?
我在MapView工作。其中,目前我正在设置注释,因此我必须设置CLLocationCoordinate2DMake,并从googleAPI解析一些lat和lng(例如:lat =37.9615000和lng =60.5566000)。我有字符串中的值,因此我将sting转换为double然后分配但是它没有帮助。请有人帮助我。
I am working in MapView. Where, at present I am setting annotation and hence I have to set CLLocationCoordinate2DMake with some lat and lng parsed from googleAPI (Eg:lat = "37.9615000" and lng = "60.5566000") . I have the values in string, hence I converted the sting to double and then assigned But it didn't help. Please some one help me.
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
actual values are: 37.9615000,60.5566000Values I get in NSLog: 37.961498, 60.556599
提前致谢。
更多解释以及我需要确切价值的原因:
More explanation and reason why I need exact value:
我需要为中国设置注释其lat和lan(lat =53.5609740;
lng =134.7728099)
I need to set annotation for china With its lat and lan ( lat = "53.5609740"; lng = "134.7728099")
但是当从字符串再次转换时,值会发生变化
But while converting again from string the value changes
推荐答案
annotation.coordinate=CLLocationCoordinate2DMake([nums doubleValue], [int2 doubleValue]);
试试这个
这篇关于哪个dataType将返回值(37.961498)?双重无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!