Swift : Convert (cast) String to Double
Helping out a colleague to solve this simple task of converting string value to double today. Putting down this solution here and hope it can be useful as tutorial for other Swift programmers.
Problem :
How to convert (cast) String to Double in Swift programming language ?
Solution :
var str = "123.456"
var doubleNSString = NSString(string: str)
var toDouble = doubleNSString.doubleValue
Reference :
See also : Swift : Convert (cast) Int to String ?
By Adam Ng
IF you gain some knowledge or the information here solved your programming problem. Please consider donating to the less fortunate or some charities that you like. Apart from donation, planting trees, volunteering or reducing your carbon footprint will be great too.
Advertisement
Tutorials
+8.6k PHP : How to parse ElasticSearch JSON ?
+29.5k Golang : JQuery AJAX post data to server and send data back to client example
+14.6k Golang : Find network of an IP address
+21.3k Golang : Convert(cast) string to rune and back to string example
+18.1k Golang : Defer function inside init()
+5.5k Golang : Get S3 or CloudFront object or file information
+7.5k Golang : Convert source code to assembly language
+20k Golang : Count JSON objects and convert to slice/array
+5.5k Gogland : Datasource explorer
+6.9k Golang : Muxing with Martini example
+17.9k Golang : Iterate linked list example
+14.1k Golang : Google Drive API upload and rename example