In Swift 3 I am getting the following error (which wasn't happening in Swift 2):
No * candidates produce the expected result type FloatingPointRoundingRule
I don't know what I need to do to fix it.
I am trying to convert latitude decimal to degrees/minutes/seconds
extension CLLocationDegrees {
mutating func toLatitudeSeconds() -> String {
var seconds = Int(round(self * 3600)) //error here
// etc ...
}
}
The rounding functions were changed to be called on an instance rather than being global functions. You're basically trying to do self.round(self*3600) which doesn't work because the round function takes either no argument or an argument of type FloatingPointRoundingRule.
You probably want:
var seconds = Int((self*3600).rounded())
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With