Convert String to double when comma is used
问题 I have a UITextfield and it is being populated by data from database. The value is formatted in a way that the fractional part is separated by comma. So, the Structure is something like 1,250.50 I save the data in a string and when I try to use the doubleValue method to convert the string to a double or floating number. I am getting 1. Here is my code. NSString *price = self.priceField.text; //here price = 1,250.50 double priceInDouble = [price doubleValue]; Here I get 1 instead of 1250.50. I