I have UITextField with Decimal Pad and i want to convert it's value to float.
var myValue: Float = NSString(string: myTextField.text).floatValue
On my emulator i have no problems: in Decimal Pad i see numbers and "." so i can enter values like 123.45, but on device i have a problem because on decimal pad i see numbers and ",". So after adding "123,45" to myTextField i see that
myValue = 123
I know that i can change "." to "," in setting but i am really not sure about my app users.
So my problem is - how can i get float value from decimal pad not only with "." using Swift?
I see two kind of solutions: 1) how can i config decimal pad to show "." instead of "," on any device? 2) how can i convert to float strings with "," delimiter?