Convert CGFloat to NSNumber in Swift
For Swift 3.1
var final_price: CGFloat = 12.34
let num = final_price as NSNumber
In Swift 3.0
let myFloat : CGFloat = 1234.5
let myNumber = NSNumber(value: Float(myFloat))
or
let myNumber = NSNumber(value: Double(myFloat))
In Swift 2
let myNumber = NSNumber(double: myFloat.native)
or
let myNumber = NSNumber(double: Double(myFloat))
or
let myNumber = NSNumber(float: Float(myFloat))