Converting to a number in Swift

//to Int
let strNumber = "42"
let number: Int = Int(strNumber)!

//to Double and Float
//the first method
let strPi = "3.14"
let pi: Float = Float(atof(strPi))

//the second method
let strExp = "2.71828"
let exp = (strExp as NSString).doubleValue

//the third method
let strHalf = "0,5"
let formatter = NSNumberFormatter()
formatter.decimalSeparator = ","
let half = formatter.numberFromString(strHalf)!.doubleValue