Converting text to number and vice versa
check to see if it able to convert
if let num = Double(nameOfString)
{
}
To change the type using the if/let statements, you need to unwrap what you have casted using '!'.
result = (Double(nameOfString))!
or
result = (Double(nameOfLabel.text!))!
if let num = Double(nameOfString)
{
}
To change the type using the if/let statements, you need to unwrap what you have casted using '!'.
result = (Double(nameOfString))!
or
result = (Double(nameOfLabel.text!))!
Comments
Post a Comment