The following code snippet causes the compiler to flag an error. Fix it.
var amount = "1200" var rate = "1.27" var result = amount * rate
You can cast the strings as NSString first and then use the doubleValue property to extract their double values:
var amount = "1200" var rate = "1.27" var result = (amount as NSString).doubleValue * (rate as NSString).doubleValue print(result)// w ww . j av a 2 s . c o m