I\'m migrating a project from Swift 2.2 to Swift 3, and I\'m trying to get rid of old Cocoa data types when possible.
My problem is
Solution that works in Swift 4
let double = 3.14 let decimal = Decimal(double) let doubleFromDecimal = NSDecimalNumber(decimal: decimal).doubleValue print(doubleFromDecimal)