Swift – Convert String to Double

Standard

Swift has conventions to convert a string into an int

But for doubles, lets say you want var dblString = “5.559” converted from a string to a double. You can’t just do dblString.toDouble()!, not going to happen it just gives an error. So the solution for now is to use Objective-C

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.