Convert String to float in Apple's Swift
问题 I\'m trying to convert numbers taken from a UITextField, which I presume, are actually strings, and convert them to float, so I can multiply them. I have two UITextfield s which are declared as follows: @IBOutlet var wage: UITextField @IBOutlet var hour: UITextField When the user presses a UIButton I want to calculate the wages the user earns, but I can\'t, as I need to convert them to floats first, before I can use them. I know how to convert them to an integer by doing this: var