parsing to double any data type in swift

Swift
let lessPrecisePI = Float("3.14")
let morePrecisePI = Double("3.1415926536")
let width = CGFloat(Double("200.0")!)let wholeNumber = Int("27")
let smallInt = Int16("34")
let largeInt = Int64("39384")if let cost = Double(textField.text!) {
    print("The item is valued at: \(cost)")
} else {
    print("Not a valid number: \(textField.text!)")
}
Source

Also in Swift: