我将浮点数传递给一个方法,但它没有显示所有小数。我不知道为什么会这样。
这是一个例子:
[[LocationApiCliente sharedInstance] nearPlacesUsingLatitude:-58.3645248331830402 andLongitude:-34.6030467894227982];
然后:
- (BOOL)nearPlacesUsingLatitude:(double)latitude andLongitude:(double) longitude {
NSString *urlWithCoords = [NSString stringWithFormat:@"%@&lat=%f&long=%f", CountriesPath, latitude, longitude];
打印 urlWithCoords 将导致:
格式=json&lat=-58.364525&long=-34.603047
更多这样的。我从输出终端得到什么:
(lldb) p -3.13419834918349f
(float) $4 = -3.1342
(lldb) p -3.13419834918349
(double) $5 = -3.1342
有任何想法吗?