I was trying to save the coordinates
(75.8572998 = 7 digits after decimal point)
to NSUSERDEFAULT
.
But when I fetch it back it shows the value only up to 3 digits after decimal
i.e. 75.857.
I tried to convert the coordinates to string or float before saving it to user defaults.
But no luck.
let locationValue:CLLocationCoordinate2D = manager.location!.coordinate
let latitude : Float = Float(locationValue.latitude)
print("location = \(latitude)")
NSUSERDEFAULT.set(latitude, forKey: "lat")
print(NSUSERDEFAULT.double(forKey: "lat"))
location = (30.9009991)
30.9009990692139