Swift : Convert (cast) String to Float
Problem :
You have a string value and you need to convert the string into type float.
Solution :
Use NSString for direct casting from type string to float. For example :
var StrToFloat = (SomeInputString.text as NSString).floatValue
See also : Swift : Convert (cast) String to Integer
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
+6.6k Golang : md5 hash of a string
+2.2k Javascript : How to get width and height of a div?
+12.8k PHP : Convert(cast) int to double/float
+2.2k Golang : Lock executable to a specific machine with unique hash of the machine
+2.9k Get Facebook friends working in same company
+2.5k PHP : Convert CSV to JSON with YQL example
+20.8k Golang : How to stream file to client(browser) or write to http.ResponseWriter?
+5.2k Golang : flag provided but not defined error
+3.5k Golang : Generate Codabar
+15.3k Golang : How to check if a connection to database is still alive ?
+3.9k Mac OSX : Get a process/daemon status information
+7.3k Golang : Get the IPv4 and IPv6 addresses for a specific network interface